Files
dotfiles/doom.d/config.org
2019-07-24 12:28:06 +01:00

3.0 KiB

Oreodave's emacs configuration

Preclude

This is my Doom Emacs configuration, which I try to use for as many things as possibe. It is currently my main C# and Python editor but hopefully it will become my C one soon!

My previous editors are VSCode, the JetBrains IDEs and spacemacs (yes, I count spacemacs as its own editor!). I still do use VSCode for debugging unit tests or if I'm collaborating with someone else.

I currently use Vim + tmux and Doom Emacs (woo!) for my current workflow. I always have both open - playing music, doing quick config edits, running servers and large jobs in my tmux session. I do project work, writing and overall coding in emacs.

Global variables

(setq doom-localleader-key ",")

Theming

(load-theme 'doom-molokai t)

General keymap

(map!
 :leader
 :desc   "M-x"                "<SPC>" 'counsel-M-x
 :desc   "Indent"             "j"     'indent-region
 :desc   "Open calendar"      "rc"    '(lambda() (interactive) (find-file "~/Text/calendar.org"))
 :desc   "Open project files" "pf"    'projectile-find-file

 (:prefix "/" ; Search
   :desc "Ag!"                "a"     '+ivy/ag
   :desc "Search buffer"      "/"     'swiper
   )

 (:prefix "w" ; Windows
   :desc "Close window"       "d"     '+workspace/close-window-or-workspace
   :desc "Switch window"      "W"     'ace-window
   )

 (:prefix "b"
   :desc "Close buffer"       "d"     'doom/kill-this-buffer-in-all-windows
   )
 )

Plugins and Packages

Elcord

(after! elcord
  (elcord-mode))

Languages

C#

(after! csharp-mode
  (setq omnisharp-server-executable-path "~/bin/omnisharp/run")
  (add-hook 'csharp-mode-hook '(lambda() (setq c-basic-offset 4))) ; Hook for csharp setting variables

  (map! ; CSharp Keybinds
   :map csharp-mode-map
   :localleader
   :desc   "Format buffer"  "="    'omnisharp-code-format-entire-file
   (:prefix "t"
     :desc "Unit Test This" "t"   'omnisharp-unit-test-at-point
     :desc "Unit Test Last" "l"   'omnisharp-unit-test-last
     :desc "Unit Test All"  "b"   'omnisharp-unit-test-buffer
     )
   )
  )

Python

(after! python
  (setq python-version-checked t)
  (setq python-python-command "python3")
  (setq python-shell-interpreter "python3")
  (setq flycheck-python-pycompile-executable "python3")

  (map! ; Python keybinds
   :map python-mode-map
   :localleader
   :desc "Start python minor" "c" 'run-python
   (:prefix "s"
     :desc "Send region REPL" "r" 'python-shell-send-region
     :desc "Send buffer"      "b" 'python-shell-send-buffer
     :desc "Send function"    "f" 'python-shell-send-defun
     )
   )
  )

Org

(after! org
  (map! ; Org keybinds
   :map org-mode-map
   :localleader
   :desc "Org dispatch" "ee" 'org-export-dispatch
   )
  )