-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.el
254 lines (222 loc) · 8.65 KB
/
config.el
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
(beacon-mode 1)
(setq centaur-tabs-set-bar 'over
centaur-tabs-set-icons t
centaur-tabs-gray-out-icons 'buffer
centaur-tabs-height 24
centaur-tabs-set-modified-marker t
centaur-tabs-style "bar"
centaur-tabs-modified-marker "•")
(map! :leader
:desc "Toggle tabs globally" "t c" #'centaur-tabs-mode
:desc "Toggle tabs local display" "t C" #'centaur-tabs-local-mode)
(evil-define-key 'normal centaur-tabs-mode-map (kbd "g <right>") 'centaur-tabs-forward ; default Doom binding is 'g t'
(kbd "g <left>") 'centaur-tabs-backward ; default Doom binding is 'g T'
(kbd "g <down>") 'centaur-tabs-forward-group
(kbd "g <up>") 'centaur-tabs-backward-group)
(use-package! citar
:no-require
:custom
(org-cite-insert-processor 'citar)
(org-cite-follow-processor 'citar)
(org-cite-activate-processor 'citar)
(citar-bibliography org-cite-global-bibliography))
(map! :leader
(:prefix ("d" . "dired")
:desc "Open dired" "d" #'dired
:desc "Dired jump to current" "j" #'dired-jump)
(:after dired
(:map dired-mode-map
:desc "Peep-dired image previews" "d p" #'peep-dired
:desc "Dired view file" "d v" #'dired-view-file)))
(evil-define-key 'normal dired-mode-map
(kbd "M-RET") 'dired-display-file
(kbd "h") 'dired-up-directory
(kbd "l") 'dired-open-file ; use dired-find-file instead of dired-open.
(kbd "m") 'dired-mark
(kbd "t") 'dired-toggle-marks
(kbd "u") 'dired-unmark
(kbd "C") 'dired-do-copy
(kbd "D") 'dired-do-delete
(kbd "J") 'dired-goto-file
(kbd "M") 'dired-do-chmod
(kbd "O") 'dired-do-chown
(kbd "P") 'dired-do-print
(kbd "R") 'dired-do-rename
(kbd "T") 'dired-do-touch
(kbd "Y") 'dired-copy-filenamecopy-filename-as-kill ; copies filename to kill ring.
(kbd "Z") 'dired-do-compress
(kbd "+") 'dired-create-directory
(kbd "-") 'dired-do-kill-lines
(kbd "% l") 'dired-downcase
(kbd "% m") 'dired-mark-files-regexp
(kbd "% u") 'dired-upcase
(kbd "* %") 'dired-mark-files-regexp
(kbd "* .") 'dired-mark-extension
(kbd "* /") 'dired-mark-directories
(kbd "; d") 'epa-dired-do-decrypt
(kbd "; e") 'epa-dired-do-encrypt)
;; Get file icons in dired
(add-hook 'dired-mode-hook 'all-the-icons-dired-mode)
;; With dired-open plugin, you can launch external programs for certain extensions
;; For example, I set all .png files to open in 'sxiv' and all .mp4 files to open in 'mpv'
(setq dired-open-extensions '(("gif" . "sxiv")
("jpg" . "sxiv")
("png" . "sxiv")
("mkv" . "mpv")
("mp4" . "mpv")))
(evil-define-key 'normal peep-dired-mode-map
(kbd "j") 'peep-dired-next-file
(kbd "k") 'peep-dired-prev-file)
(add-hook 'peep-dired-hook 'evil-normalize-keymaps)
(setq delete-by-moving-to-trash t
trash-directory "~/.local/share/Trash/files/")
;; Whenever you reconfigure a package, make sure to wrap your config in an
;; `after!' block, otherwise Doom's defaults may override your settings. E.g.
;;
;; (after! PACKAGE
;; (setq x y))
;;
;; The exceptions to this rule:
;;
;; - Setting file/directory variables (like `org-directory')
;; - Setting variables which explicitly tell you to set them before their
;; package is loaded (see 'C-h v VARIABLE' to look up their documentation).
;; - Setting doom variables (which start with 'doom-' or '+').
;;
;; Here are some additional functions/macros that will help you configure Doom.
;;
;; - `load!' for loading external *.el files relative to this one
;; - `use-package!' for configuring packages
;; - `after!' for running code after a package has loaded
;; - `add-load-path!' for adding directories to the `load-path', relative to
;; this file. Emacs searches the `load-path' when you load packages with
;; `require' or `use-package'.
;; - `map!' for binding new keys
;;
;; To get information about any of these functions/macros, move the cursor over
;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k').
;; This will open documentation for it, including demos of how they are used.
;; Alternatively, use `C-h o' to look up a symbol (functions, variables, faces,
;; etc).
;;
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
;; they are implemented.
(setq evil-split-window-below t
evil-vsplit-window-right t)
(setq evil-want-fine-undo t)
(setq evil-ex-substitute-global t)
(setq evil-kill-on-visual-paste nil)
(setq evil-disable-insert-state-bindings t)
(setq doom-theme 'catppuccin)
(map! :leader
:desc "Load new theme" "h t" #'counsel-load-theme)
(setq doom-font (font-spec :family "JetBrains Mono" :size 36)
doom-variable-pitch-font (font-spec :family "Ubuntu" :size 36)
doom-big-font (font-spec :family "JetBrains Mono" :size 40))
(after! doom-themes
(setq doom-themes-enable-bold t
doom-themes-enable-italic t))
(custom-set-faces!
'(font-lock-comment-face :slant italic)
'(font-lock-keyword-face :slant italic))
(remove-hook! '(org-mode-hook text-mode-hook conf-mode-hook)
#'display-line-numbers-mode)
(require 'ob-async)
(setq org-babel-default-header-args:jupyter-python
'((:results . "both")
;; This seems to lead to buffer specific sessions!
(:session . (lambda () (buffer-file-name)))
(:kernel . "python3")
(:pandoc . "t")
(:exports . "both")
(:cache . "no")
(:noweb . "no")
(:hlines . "no")
(:tangle . "no")
(:eval . "never-export")))
(with-eval-after-load 'ob-jupyter
(org-babel-jupyter-aliases-from-kernelspecs))
(use-package! doom-modeline
:config
(setq doom-modeline-persp-name t
doom-modeline-height 35
display-time-mode t))
(after! org
(require 'org-tempo)
(pushnew! org-structure-template-alist
'("el" . "src emacs-lisp")
'("sh" . "src shell")
'("py" . "src python")))
(after! org
(setq org-capture-templates
'(("t" "Todo" entry (file+headline "Todo.org" "00 INBOX")
"* TODO %? \n %i ")
("n" "Novel Note" entry (file+headline "~/org/outline.org" "Novel Inbox")
"* %? \n %i\n %a "))))
(after! org
(setq org-todo-keywords
'((sequence
"TODO(t)" ; A task that needs doing & is ready to do
"PROJ(p)" ; A project, which usually contains other tasks
"NEXT(n)" ; A task that is in progress
"WAIT(t)" ; Something external is holding up this task
"HOLD(h)" ; This task is paused/on hold because of me
"OPEN(o)" ; An open or ongoing loop
"|"
"DONE(d)" ; Task successfully completed
"KILL(K)") ; Task was cancelled, aborted or is no longer applicable
(sequence
"[ ](T)" ; A task that needs doing
"[-](S)" ; Task is in progress
"[?](W)" ; Task is being held up or paused
"|"
"[X](D)") ; Task was completed
(sequence ; adapted from Tony Ballantyne's writing methodology
"IDEA(i!)"
"WRITE(w!)"
"EDIT(e!)"
"WORKING(k!)"
"|"
"USED(u!/@)"))))
(defun zz/adjust-org-company-backends ()
(remove-hook 'after-change-major-mode-hook '+company-init-backends-h)
(setq-local company-backends nil))
(add-hook! org-mode (zz/adjust-org-company-backends))
(setq doom-modeline-enable-word-count t)
(defun my-split-and-indirect-orgtree ()
"Splits window to the right and opens an org tree section in it"
(interactive)
(split-window-right)
(windmove-right)
(org-tree-to-indirect-buffer))
(defun my-kill-and-unsplit-orgtree ()
"Kills the cloned buffer and deletes the window."
(interactive)
(kill-this-buffer)
(delete-window))
(define-globalized-minor-mode global-rainbow-mode rainbow-mode
(lambda ()
(when (not (memq major-mode
(list 'org-agenda-mode)))
(rainbow-mode 1))))
(global-rainbow-mode 1 )
(setq vterm-always-compile-module t)
(setq vterm-kill-buffer-on-exit t)
(after! vterm
(define-key vterm-mode-map (kbd "<C-backspace>") (lambda () (interactive) (vterm-send-key (kbd "C-w")))))
(after! vterm
(setf (alist-get "woman" vterm-eval-cmds nil nil #'equal)
'((lambda (topic)
(woman topic))))
(setf (alist-get "magit-status" vterm-eval-cmds nil nil #'equal)
'((lambda (path)
(magit-status path))))
(setf (alist-get "dired" vterm-eval-cmds nil nil #'equal)
'((lambda (dir)
(dired dir)))))
(use-package! multi-vterm
:after vterm)
(setq vterm-shell "/usr/bin/zsh")
(map! :leader
:desc "Zap to char" "z" #'zap-to-char
:desc "Zap up to char" "Z" #'zap-up-to-char)