aboutsummaryrefslogtreecommitdiff
path: root/doom.d/config.org
blob: dafc273f272f17c0ad6e1c2e749efb60821a27a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#+TITLE: Oreodave's emacs configuration
#+AUTHOR: Oreodave
#+DESCRIPTION: My Doom Emacs configuration!

* Preclude
This is my [[https://github.com/hlissner/doom-emacs][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 [[http://spacemacs.org][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
#+BEGIN_SRC emacs-lisp
(setq doom-localleader-key ",")
#+END_SRC
'<SPC>m' is right next to ',', so may as well use one tap instead of two

* Theming
#+BEGIN_SRC emacs-lisp
(load-theme 'doom-molokai t)
#+END_SRC
I like monokai :)

* General keymap
#+BEGIN_SRC emacs-lisp
(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
#+END_SRC
- Redefine <SPC><SPC> as M-x rather than find-file because of my muscle memory
  with spacemacs
- General maps like <SPC>j for indenting because I don't know what else to bind
  them to
- <SPC>pf => project -> find file
#+BEGIN_SRC emacs-lisp
 (:prefix "/" ; Search
   :desc "Ag!"                "a"     '+ivy/ag
   :desc "Search buffer"      "/"     'swiper
   )
#+END_SRC
- I like using <SPC>/ in comparison to <SPC>s: it's closer together (thus
  quicker, I do searches a lot so this is noticeable) and makes more sense
- Ag is actually insanely useful, especially at a quick keybind
- <SPC>// is quicker to do than <SPC>/b, for something that is done so often

#+BEGIN_SRC emacs-lisp
 (: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
   )
 )
#+END_SRC

* Plugins and Packages

** Elcord
#+BEGIN_SRC emacs-lisp
(after! elcord
  (elcord-mode))
#+END_SRC
* Languages

** C#
#+BEGIN_SRC emacs-lisp
(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
     )
   )
  )
#+END_SRC

** Python
#+BEGIN_SRC emacs-lisp
(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
     )
   )
  )
#+END_SRC
** Org
#+BEGIN_SRC emacs-lisp
(after! org
  (map! ; Org keybinds
   :map org-mode-map
   :localleader
   :desc "Org dispatch" "ee" 'org-export-dispatch
   )
  )
#+END_SRC