diff options
author | jdlugosz963 <jdlugosz963@gmail.com> | 2022-09-21 20:58:14 +0200 |
---|---|---|
committer | jdlugosz963 <jdlugosz963@gmail.com> | 2022-09-21 20:58:14 +0200 |
commit | 801cd6dfd4fbed882095bec66e5335f3c154606a (patch) | |
tree | b6693359eb04d660ce4377b9943eeee49b30deb8 | |
parent | 198fd463d53cbd2b5a76bb18e07ed78f7f90195c (diff) | |
download | dotfiles-801cd6dfd4fbed882095bec66e5335f3c154606a.tar.gz dotfiles-801cd6dfd4fbed882095bec66e5335f3c154606a.zip |
Update Emacs config
-rw-r--r-- | .config/emacs/init.el | 174 | ||||
-rw-r--r-- | Emacs.org | 319 |
2 files changed, 432 insertions, 61 deletions
diff --git a/.config/emacs/init.el b/.config/emacs/init.el index b9a465c..c33d57c 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el | |||
@@ -38,6 +38,8 @@ | |||
38 | 38 | ||
39 | (require 'use-package) | 39 | (require 'use-package) |
40 | 40 | ||
41 | (push ".config/emacs/jd/" load-path) | ||
42 | |||
41 | (use-package general | 43 | (use-package general |
42 | :config | 44 | :config |
43 | (general-create-definer jd/leader-key-def | 45 | (general-create-definer jd/leader-key-def |
@@ -59,9 +61,12 @@ | |||
59 | (setq evil-want-integration t) | 61 | (setq evil-want-integration t) |
60 | (setq evil-want-keybinding nil) | 62 | (setq evil-want-keybinding nil) |
61 | (setq evil-want-C-u-scroll t) | 63 | (setq evil-want-C-u-scroll t) |
62 | (setq evil-want-C-i-jump nil) | 64 | (setq evil-want-Y-yank-to-eol t) |
65 | (setq evil-want-C-i-jump nil) | ||
63 | (setq evil-undo-system 'undo-tree) | 66 | (setq evil-undo-system 'undo-tree) |
67 | (setq evil-kill-on-visual-paste nil) | ||
64 | :config | 68 | :config |
69 | (evil-set-initial-state 'exwm-mode 'emacs) | ||
65 | (evil-mode 1)) | 70 | (evil-mode 1)) |
66 | 71 | ||
67 | (use-package evil-collection | 72 | (use-package evil-collection |
@@ -69,8 +74,16 @@ | |||
69 | :config | 74 | :config |
70 | (evil-collection-init)) | 75 | (evil-collection-init)) |
71 | 76 | ||
77 | (defhydra hydra-resize-window (:timeout 4) | ||
78 | ("h" evil-window-decrease-width "<") | ||
79 | ("l" evil-window-increase-width ">") | ||
80 | ("k" evil-window-decrease-height "^") | ||
81 | ("j" evil-window-increase-height "v") | ||
82 | ("q" nil "finished" :exit t)) | ||
83 | |||
72 | (jd/leader-key-def | 84 | (jd/leader-key-def |
73 | "w" 'evil-window-map | 85 | "w" 'evil-window-map |
86 | "wr" '(hydra-resize-window/body :which-key "Rezize window") | ||
74 | "wd" '(evil-window-delete :which-key "Window delete")) | 87 | "wd" '(evil-window-delete :which-key "Window delete")) |
75 | 88 | ||
76 | (jd/leader-key-def | 89 | (jd/leader-key-def |
@@ -96,7 +109,7 @@ | |||
96 | 109 | ||
97 | (use-package doom-themes | 110 | (use-package doom-themes |
98 | :config | 111 | :config |
99 | (load-theme 'doom-molokai t)) | 112 | (load-theme 'doom-badger t)) |
100 | 113 | ||
101 | (use-package diminish) | 114 | (use-package diminish) |
102 | 115 | ||
@@ -115,7 +128,6 @@ | |||
115 | "\\`\\([^T]\\|T\\($\\|[^A]\\|A\\($\\|[^G]\\|G\\($\\|[^S]\\|S.\\)\\)\\)\\).*"))) | 128 | "\\`\\([^T]\\|T\\($\\|[^A]\\|A\\($\\|[^G]\\|G\\($\\|[^S]\\|S.\\)\\)\\)\\).*"))) |
116 | (call-interactively 'counsel-switch-buffer))) | 129 | (call-interactively 'counsel-switch-buffer))) |
117 | 130 | ||
118 | (use-package counsel) | ||
119 | (use-package ivy | 131 | (use-package ivy |
120 | :diminish | 132 | :diminish |
121 | :bind | 133 | :bind |
@@ -128,6 +140,10 @@ | |||
128 | :config | 140 | :config |
129 | (ivy-mode 1)) | 141 | (ivy-mode 1)) |
130 | 142 | ||
143 | (use-package counsel | ||
144 | :config | ||
145 | (counsel-mode 1)) | ||
146 | |||
131 | (jd/leader-key-def | 147 | (jd/leader-key-def |
132 | "t" '(:ignore t :which-key "Toogle") | 148 | "t" '(:ignore t :which-key "Toogle") |
133 | "tt" '(counsel-load-theme :which-key "Choose theme")) | 149 | "tt" '(counsel-load-theme :which-key "Choose theme")) |
@@ -150,6 +166,35 @@ | |||
150 | :init (doom-modeline-mode 1) | 166 | :init (doom-modeline-mode 1) |
151 | :custom ((doom-modeline-height 15))) | 167 | :custom ((doom-modeline-height 15))) |
152 | 168 | ||
169 | (use-package hydra | ||
170 | :defer t) | ||
171 | |||
172 | (defun jd/text-scale-increase () | ||
173 | (interactive) | ||
174 | (let ((old-face-attribute (face-attribute 'default :height))) | ||
175 | (set-face-attribute 'default nil :height (+ old-face-attribute 10)))) | ||
176 | |||
177 | (defun jd/text-scale-decrease () | ||
178 | (interactive) | ||
179 | (let ((old-face-attribute (face-attribute 'default :height))) | ||
180 | (set-face-attribute 'default nil :height (- old-face-attribute 10)))) | ||
181 | |||
182 | (defhydra hydra-text-scale-global (:timeout 4) | ||
183 | "scale text" | ||
184 | ("j" jd/text-scale-increase "in") | ||
185 | ("k" jd/text-scale-decrease "out") | ||
186 | ("q" nil "finished" :exit t)) | ||
187 | |||
188 | (defhydra hydra-text-scale (:timeout 4) | ||
189 | "scale text" | ||
190 | ("j" text-scale-increase "in") | ||
191 | ("k" text-scale-decrease "out") | ||
192 | ("q" nil "finished" :exit t)) | ||
193 | |||
194 | (jd/leader-key-def | ||
195 | "tS" '(hydra-text-scale-global/body :which-key "Scale text") | ||
196 | "ts" '(hydra-text-scale/body :which-key "Scale text")) | ||
197 | |||
153 | (use-package beacon | 198 | (use-package beacon |
154 | :config | 199 | :config |
155 | (beacon-mode 1)) | 200 | (beacon-mode 1)) |
@@ -173,7 +218,7 @@ | |||
173 | (mapc 'kill-buffer (cdr (buffer-list (current-buffer))))) | 218 | (mapc 'kill-buffer (cdr (buffer-list (current-buffer))))) |
174 | 219 | ||
175 | (jd/leader-key-def | 220 | (jd/leader-key-def |
176 | "bK" '(jd/kill-other-buffers :which-key "Kill other buffers")) | 221 | "bK" '(jd/kill-other-buffers :which-key "Kill other buffers") |
177 | "bk" '(kill-current-buffer :which-key "Kill buffer") | 222 | "bk" '(kill-current-buffer :which-key "Kill buffer") |
178 | "bB" '(ibuffer :which-key "Open ibuffer")) | 223 | "bB" '(ibuffer :which-key "Open ibuffer")) |
179 | 224 | ||
@@ -186,20 +231,50 @@ | |||
186 | :pin org | 231 | :pin org |
187 | :commands (org-capture org-agenda) | 232 | :commands (org-capture org-agenda) |
188 | :hook (org-mode . jd/org-mode-setup) | 233 | :hook (org-mode . jd/org-mode-setup) |
189 | :init | 234 | :config |
235 | (setq org-directory (file-truename "~/Documents/org/")) | ||
236 | (setq org-mobile-inbox-for-pull (concat org-directory "flagged.org")) | ||
237 | (setq org-mobile-directory "~/Dropbox/Apps/MobileOrg") | ||
238 | (setq org-agenda-files | ||
239 | '("Tasks.org")) | ||
190 | (setq org-ellipsis " ▾") | 240 | (setq org-ellipsis " ▾") |
191 | (setq org-agenda-start-with-log-mode t) | 241 | (setq org-agenda-start-with-log-mode t) |
192 | (setq org-log-done 'time) | 242 | (setq org-log-done 'time) |
193 | (setq org-log-into-drawer t) | 243 | (setq org-log-into-drawer t) |
194 | (setq org-return-follows-link t) | 244 | (setq org-return-follows-link t) |
195 | :config | 245 | (setq org-capture-templates |
196 | (menu-bar--display-line-numbers-mode-none) | 246 | `(("t" "Tasks / Projects") |
247 | ("tt" "Task" entry (file+olp "Tasks.org" "Inbox") | ||
248 | "* TODO %?\n %t\n %a\n %i" :empty-lines 1) | ||
249 | ("tT" "Task for tomorow" entry (file+olp "Tasks.org" "Inbox") | ||
250 | "* TODO %?\n %t\n SCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+1d\"))\n %a\n %i" :empty-lines 1) | ||
251 | |||
252 | ("m" "Metrics Capture") | ||
253 | ("mm" "Metrics" table-line (file+headline "Metrics.org" "Metrics") | ||
254 | "| %U | %^{Weight} | %^{Waist} | %^{Notes} |" :kill-buffer t))) | ||
255 | |||
256 | (setq org-latex-listings 'minted | ||
257 | org-latex-packages-alist '(("" "minted")) | ||
258 | org-latex-pdf-process | ||
259 | '("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f" | ||
260 | "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f")) | ||
261 | |||
197 | (require 'org-tempo)) | 262 | (require 'org-tempo)) |
198 | 263 | ||
199 | (jd/leader-key-def | 264 | (jd/leader-key-def |
200 | "o" '(:ignore t :which-key "Open") | 265 | "o" '(:ignore t :which-key "Open/Org") |
266 | "oc" '(org-capture :which-key "Open org-capture") | ||
267 | "oop" '(org-mobile-pull :which-key "Org mobile pull") | ||
268 | "ooP" '(org-mobile-push :which-key "Org mobile push") | ||
201 | "oa" '(org-agenda :which-key "Open org-agenda")) | 269 | "oa" '(org-agenda :which-key "Open org-agenda")) |
202 | 270 | ||
271 | (use-package evil-org | ||
272 | :after org | ||
273 | :hook (org-mode . (lambda () evil-org-mode)) | ||
274 | :config | ||
275 | (require 'evil-org-agenda) | ||
276 | (evil-org-agenda-set-keys)) | ||
277 | |||
203 | (use-package toc-org | 278 | (use-package toc-org |
204 | :config | 279 | :config |
205 | (add-hook 'org-mode-hook 'toc-org-mode)) | 280 | (add-hook 'org-mode-hook 'toc-org-mode)) |
@@ -237,6 +312,8 @@ | |||
237 | (with-eval-after-load 'org-faces (jd/org-font-setup)) | 312 | (with-eval-after-load 'org-faces (jd/org-font-setup)) |
238 | 313 | ||
239 | (defun jd/org-tempo-setup () | 314 | (defun jd/org-tempo-setup () |
315 | (add-to-list 'org-structure-template-alist '("s" . "src")) | ||
316 | (add-to-list 'org-structure-template-alist '("sql" . "src sql")) | ||
240 | (add-to-list 'org-structure-template-alist '("sh" . "src sh")) | 317 | (add-to-list 'org-structure-template-alist '("sh" . "src sh")) |
241 | (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp")) | 318 | (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp")) |
242 | (add-to-list 'org-structure-template-alist '("li" . "src lisp")) | 319 | (add-to-list 'org-structure-template-alist '("li" . "src lisp")) |
@@ -248,6 +325,11 @@ | |||
248 | 325 | ||
249 | (with-eval-after-load 'org-tempo (jd/org-tempo-setup)) | 326 | (with-eval-after-load 'org-tempo (jd/org-tempo-setup)) |
250 | 327 | ||
328 | (org-babel-do-load-languages | ||
329 | 'org-babel-load-languages | ||
330 | '((emacs-lisp . t) | ||
331 | (python . t))) | ||
332 | |||
251 | (defun jd/org-babel-tangle-config () | 333 | (defun jd/org-babel-tangle-config () |
252 | (when (string-equal (file-name-directory (buffer-file-name)) | 334 | (when (string-equal (file-name-directory (buffer-file-name)) |
253 | (expand-file-name "~/dotfiles/")) | 335 | (expand-file-name "~/dotfiles/")) |
@@ -272,6 +354,20 @@ | |||
272 | (setq org-superstar-remove-leading-stars t) | 354 | (setq org-superstar-remove-leading-stars t) |
273 | (setq org-superstar-headline-bullets-list '("◉" "○" "●" "○" "●" "○" "●"))) | 355 | (setq org-superstar-headline-bullets-list '("◉" "○" "●" "○" "●" "○" "●"))) |
274 | 356 | ||
357 | (defun jd/org-roam-filter-by-tag (tag-name) | ||
358 | (lambda (node) | ||
359 | (member tag-name (org-roam-node-tags node)))) | ||
360 | |||
361 | (defun jd/org-roam-list-notes-by-tag (tag-name) | ||
362 | (mapcar #'org-roam-node-file | ||
363 | (seq-filter | ||
364 | (jd/org-roam-filter-by-tag tag-name) | ||
365 | (org-roam-node-list)))) | ||
366 | |||
367 | (defun jd/org-roam-refreshagenda-list () | ||
368 | (interactive) | ||
369 | (setq org-agenda-files (org-roam-list-files))) | ||
370 | |||
275 | (use-package org-roam | 371 | (use-package org-roam |
276 | :custom | 372 | :custom |
277 | (org-roam-directory (file-truename "~/Documents/org/roam/")) | 373 | (org-roam-directory (file-truename "~/Documents/org/roam/")) |
@@ -282,6 +378,8 @@ | |||
282 | ("C-c n c" . org-roam-capture) | 378 | ("C-c n c" . org-roam-capture) |
283 | ;; Dailies | 379 | ;; Dailies |
284 | ("C-c n j" . org-roam-dailies-capture-today)) | 380 | ("C-c n j" . org-roam-dailies-capture-today)) |
381 | :bind-keymap | ||
382 | ("C-c n d" . org-roam-dailies-map) | ||
285 | :config | 383 | :config |
286 | ;; If you're using a vertical completion framework, you might want a more informative completion interface | 384 | ;; If you're using a vertical completion framework, you might want a more informative completion interface |
287 | (setq org-roam-node-display-template (concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag))) | 385 | (setq org-roam-node-display-template (concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag))) |
@@ -308,11 +406,47 @@ | |||
308 | 406 | ||
309 | (use-package python-mode | 407 | (use-package python-mode |
310 | :hook (python-mode . lsp-deferred) | 408 | :hook (python-mode . lsp-deferred) |
311 | :hook (python-mode . jd/python-mode-setup)) | 409 | :hook (python-mode . jd/python-mode-setup) |
410 | :config | ||
411 | (add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))) | ||
312 | 412 | ||
313 | (use-package pyvenv | 413 | (use-package pyvenv |
314 | :after python-mode) | 414 | :after python-mode) |
315 | 415 | ||
416 | (use-package django-mode | ||
417 | :config | ||
418 | ;; Remove all django-mode objects from auto-mode-alist | ||
419 | (while (rassq 'django-mode auto-mode-alist) | ||
420 | (let ((django-mode-object (rassq 'django-mode auto-mode-alist))) | ||
421 | (setq auto-mode-alist (delete django-mode-object auto-mode-alist))))) | ||
422 | |||
423 | (use-package lsp-java | ||
424 | :config (add-hook 'java-mode-hook 'lsp)) | ||
425 | |||
426 | (use-package typescript-mode | ||
427 | :config | ||
428 | (setq typescript-indent-level 2) | ||
429 | (add-to-list 'auto-mode-alist '("\\.tsx\\'" . typescript-mode))) | ||
430 | |||
431 | (use-package tide | ||
432 | :ensure t | ||
433 | :after (typescript-mode company) | ||
434 | :hook ((typescript-mode . tide-setup) | ||
435 | (typescript-mode . tide-hl-identifier-mode))) | ||
436 | |||
437 | (use-package flycheck | ||
438 | :ensure t | ||
439 | :hook ((after-init . global-flycheck-mode))) | ||
440 | |||
441 | (use-package yaml-mode) | ||
442 | |||
443 | (use-package docker) | ||
444 | |||
445 | (jd/leader-key-def | ||
446 | "d" '(:ignore t :which-key "Docker") | ||
447 | "dc" '(docker-containers :which-key "Docker containers") | ||
448 | "dd" '(docker :which-key "Docker")) | ||
449 | |||
316 | (use-package dap-mode | 450 | (use-package dap-mode |
317 | ;; Uncomment the config below if you want all UI panes to be hidden by default! | 451 | ;; Uncomment the config below if you want all UI panes to be hidden by default! |
318 | ;; :custom | 452 | ;; :custom |
@@ -340,7 +474,9 @@ | |||
340 | ("<tab>" . company-indent-or-complete-common)) | 474 | ("<tab>" . company-indent-or-complete-common)) |
341 | :custom | 475 | :custom |
342 | (company-minimum-prefix-length 1) | 476 | (company-minimum-prefix-length 1) |
343 | (company-idle-delay 0.0)) | 477 | (company-idle-delay 0.0) |
478 | :config | ||
479 | (global-company-mode)) | ||
344 | 480 | ||
345 | (use-package company-box | 481 | (use-package company-box |
346 | :hook (company-mode . company-box-mode)) | 482 | :hook (company-mode . company-box-mode)) |
@@ -397,15 +533,19 @@ | |||
397 | "g" '(:ignore t :which-key "Git") | 533 | "g" '(:ignore t :which-key "Git") |
398 | "gg" '(magit-status-here :which-key "Magit status")) | 534 | "gg" '(magit-status-here :which-key "Magit status")) |
399 | 535 | ||
400 | (defun jd/open-new-vterm () | 536 | (defun jd/open-new-vterm (&optional jd/vterm-buffer-name) |
401 | (interactive) | 537 | (interactive) |
402 | (let ((buffer-name (generate-new-buffer-name vterm-buffer-name))) | 538 | (let ((buffer-name (generate-new-buffer-name vterm-buffer-name))) |
539 | (when jd/vterm-buffer-name | ||
540 | (setq buffer-name jd/vterm-buffer-name)) | ||
403 | (switch-to-buffer buffer-name) | 541 | (switch-to-buffer buffer-name) |
404 | (vterm-mode))) | 542 | (vterm-mode))) |
405 | 543 | ||
544 | |||
406 | (use-package vterm | 545 | (use-package vterm |
407 | :config | 546 | :config |
408 | (setq vterm-buffer-name "vterm")) | 547 | (setq vterm-buffer-name "vterm") |
548 | (evil-set-initial-state 'vterm-mode 'emacs)) | ||
409 | 549 | ||
410 | (jd/leader-key-def | 550 | (jd/leader-key-def |
411 | "ot" '(jd/open-new-vterm :which-key "Open terminal in current window")) | 551 | "ot" '(jd/open-new-vterm :which-key "Open terminal in current window")) |
@@ -436,4 +576,14 @@ | |||
436 | (emms-standard) | 576 | (emms-standard) |
437 | (emms-default-players) | 577 | (emms-default-players) |
438 | (emms-mode-line-disable) | 578 | (emms-mode-line-disable) |
579 | ; (setq emms-info-functions '(emms-info-tinytag)) | ||
580 | (setq emms-browser-covers 'emms-browser-cache-thumbnail-async) | ||
581 | (setq emms-lyrics-dir "~/Documents/music/lyrics") | ||
439 | (emms-add-directory-tree "~/Documents/music/")) | 582 | (emms-add-directory-tree "~/Documents/music/")) |
583 | |||
584 | (use-package pdf-tools) | ||
585 | |||
586 | ;; Load my mu4e config | ||
587 | (require 'jd-mu4e) | ||
588 | |||
589 | (setq gc-cons-threshold (* 2 1000 1000)) | ||
@@ -5,8 +5,9 @@ | |||
5 | * Table of contents :toc: | 5 | * Table of contents :toc: |
6 | - [[#startup-performance][Startup Performance]] | 6 | - [[#startup-performance][Startup Performance]] |
7 | - [[#user-information-setup][User information setup]] | 7 | - [[#user-information-setup][User information setup]] |
8 | - [[#keep-clean][Keep clean]] | 8 | - [[#stay-clean][Stay clean]] |
9 | - [[#package-setup][Package setup]] | 9 | - [[#package-setup][Package setup]] |
10 | - [[#update-path][Update Path]] | ||
10 | - [[#keboard-setup][Keboard Setup]] | 11 | - [[#keboard-setup][Keboard Setup]] |
11 | - [[#general-setup][General Setup]] | 12 | - [[#general-setup][General Setup]] |
12 | - [[#evil-mode-setup][Evil mode setup]] | 13 | - [[#evil-mode-setup][Evil mode setup]] |
@@ -15,10 +16,12 @@ | |||
15 | - [[#ivy-and-counsel][Ivy and Counsel]] | 16 | - [[#ivy-and-counsel][Ivy and Counsel]] |
16 | - [[#which-key][Which key]] | 17 | - [[#which-key][Which key]] |
17 | - [[#modline][Modline]] | 18 | - [[#modline][Modline]] |
19 | - [[#hydra][Hydra]] | ||
18 | - [[#beacon][Beacon]] | 20 | - [[#beacon][Beacon]] |
19 | - [[#other-keybindings][Other Keybindings]] | 21 | - [[#other-keybindings][Other Keybindings]] |
20 | - [[#org][Org]] | 22 | - [[#org][Org]] |
21 | - [[#org-mode-setup][Org-mode setup]] | 23 | - [[#org-mode-setup][Org-mode setup]] |
24 | - [[#org-evil][Org evil]] | ||
22 | - [[#org-make-toc][Org make toc]] | 25 | - [[#org-make-toc][Org make toc]] |
23 | - [[#org-fonts][Org fonts]] | 26 | - [[#org-fonts][Org fonts]] |
24 | - [[#org-tempo-setup][Org tempo setup]] | 27 | - [[#org-tempo-setup][Org tempo setup]] |
@@ -37,6 +40,9 @@ | |||
37 | - [[#vterm][Vterm]] | 40 | - [[#vterm][Vterm]] |
38 | - [[#dired][Dired]] | 41 | - [[#dired][Dired]] |
39 | - [[#emms][EMMS]] | 42 | - [[#emms][EMMS]] |
43 | - [[#pdf-tools][PDF Tools]] | ||
44 | - [[#mu4e][Mu4e]] | ||
45 | - [[#runtime-performance][Runtime Performance]] | ||
40 | 46 | ||
41 | * Startup Performance | 47 | * Startup Performance |
42 | 48 | ||
@@ -102,6 +108,12 @@ | |||
102 | 108 | ||
103 | #+end_src | 109 | #+end_src |
104 | 110 | ||
111 | * Update Path | ||
112 | |||
113 | #+begin_src emacs-lisp | ||
114 | (push ".config/emacs/jd/" load-path) | ||
115 | #+end_src | ||
116 | |||
105 | * Keboard Setup | 117 | * Keboard Setup |
106 | ** General Setup | 118 | ** General Setup |
107 | 119 | ||
@@ -134,9 +146,12 @@ | |||
134 | (setq evil-want-integration t) | 146 | (setq evil-want-integration t) |
135 | (setq evil-want-keybinding nil) | 147 | (setq evil-want-keybinding nil) |
136 | (setq evil-want-C-u-scroll t) | 148 | (setq evil-want-C-u-scroll t) |
137 | (setq evil-want-C-i-jump nil) | 149 | (setq evil-want-Y-yank-to-eol t) |
150 | (setq evil-want-C-i-jump nil) | ||
138 | (setq evil-undo-system 'undo-tree) | 151 | (setq evil-undo-system 'undo-tree) |
152 | (setq evil-kill-on-visual-paste nil) | ||
139 | :config | 153 | :config |
154 | (evil-set-initial-state 'exwm-mode 'emacs) | ||
140 | (evil-mode 1)) | 155 | (evil-mode 1)) |
141 | 156 | ||
142 | (use-package evil-collection | 157 | (use-package evil-collection |
@@ -150,13 +165,21 @@ | |||
150 | 165 | ||
151 | #+begin_src emacs-lisp | 166 | #+begin_src emacs-lisp |
152 | 167 | ||
168 | (defhydra hydra-resize-window (:timeout 4) | ||
169 | ("h" evil-window-decrease-width "<") | ||
170 | ("l" evil-window-increase-width ">") | ||
171 | ("k" evil-window-decrease-height "^") | ||
172 | ("j" evil-window-increase-height "v") | ||
173 | ("q" nil "finished" :exit t)) | ||
174 | |||
153 | (jd/leader-key-def | 175 | (jd/leader-key-def |
154 | "w" 'evil-window-map | 176 | "w" 'evil-window-map |
177 | "wr" '(hydra-resize-window/body :which-key "Rezize window") | ||
155 | "wd" '(evil-window-delete :which-key "Window delete")) | 178 | "wd" '(evil-window-delete :which-key "Window delete")) |
156 | 179 | ||
157 | (jd/leader-key-def | 180 | (jd/leader-key-def |
158 | "ou" '(undo-tree-visualize :which-key "Open")) | 181 | "ou" '(undo-tree-visualize :which-key "Open")) |
159 | 182 | ||
160 | ;; remove . key | 183 | ;; remove . key |
161 | (define-key evil-normal-state-map (kbd ".") '()) | 184 | (define-key evil-normal-state-map (kbd ".") '()) |
162 | #+end_src | 185 | #+end_src |
@@ -182,7 +205,7 @@ | |||
182 | 205 | ||
183 | (use-package doom-themes | 206 | (use-package doom-themes |
184 | :config | 207 | :config |
185 | (load-theme 'doom-molokai t)) | 208 | (load-theme 'doom-badger t)) |
186 | 209 | ||
187 | (use-package diminish) | 210 | (use-package diminish) |
188 | 211 | ||
@@ -205,24 +228,27 @@ | |||
205 | 228 | ||
206 | #+begin_src emacs-lisp | 229 | #+begin_src emacs-lisp |
207 | 230 | ||
208 | (defun jd/switch-buffer () | 231 | (defun jd/switch-buffer () |
209 | (interactive) | 232 | (interactive) |
210 | (let ((completion-regexp-list '("\\`[^*]" | 233 | (let ((completion-regexp-list '("\\`[^*]" |
211 | "\\`\\([^T]\\|T\\($\\|[^A]\\|A\\($\\|[^G]\\|G\\($\\|[^S]\\|S.\\)\\)\\)\\).*"))) | 234 | "\\`\\([^T]\\|T\\($\\|[^A]\\|A\\($\\|[^G]\\|G\\($\\|[^S]\\|S.\\)\\)\\)\\).*"))) |
212 | (call-interactively 'counsel-switch-buffer))) | 235 | (call-interactively 'counsel-switch-buffer))) |
213 | 236 | ||
214 | (use-package counsel) | 237 | (use-package ivy |
215 | (use-package ivy | 238 | :diminish |
216 | :diminish | 239 | :bind |
217 | :bind | 240 | (("C-s" . swiper) |
218 | (("C-s" . swiper) | 241 | :map ivy-minibuffer-map |
219 | :map ivy-minibuffer-map | 242 | ("C-k" . ivy-previous-line) |
220 | ("C-k" . ivy-previous-line) | 243 | ("C-j" . ivy-next-line) |
221 | ("C-j" . ivy-next-line) | 244 | :map ivy-switch-buffer-map |
222 | :map ivy-switch-buffer-map | 245 | ("C-k" . ivy-previous-line)) |
223 | ("C-k" . ivy-previous-line)) | 246 | :config |
224 | :config | 247 | (ivy-mode 1)) |
225 | (ivy-mode 1)) | 248 | |
249 | (use-package counsel | ||
250 | :config | ||
251 | (counsel-mode 1)) | ||
226 | 252 | ||
227 | #+end_src | 253 | #+end_src |
228 | 254 | ||
@@ -266,6 +292,41 @@ | |||
266 | 292 | ||
267 | #+end_src | 293 | #+end_src |
268 | 294 | ||
295 | ** Hydra | ||
296 | |||
297 | #+begin_src emacs-lisp | ||
298 | |||
299 | (use-package hydra | ||
300 | :defer t) | ||
301 | |||
302 | (defun jd/text-scale-increase () | ||
303 | (interactive) | ||
304 | (let ((old-face-attribute (face-attribute 'default :height))) | ||
305 | (set-face-attribute 'default nil :height (+ old-face-attribute 10)))) | ||
306 | |||
307 | (defun jd/text-scale-decrease () | ||
308 | (interactive) | ||
309 | (let ((old-face-attribute (face-attribute 'default :height))) | ||
310 | (set-face-attribute 'default nil :height (- old-face-attribute 10)))) | ||
311 | |||
312 | (defhydra hydra-text-scale-global (:timeout 4) | ||
313 | "scale text" | ||
314 | ("j" jd/text-scale-increase "in") | ||
315 | ("k" jd/text-scale-decrease "out") | ||
316 | ("q" nil "finished" :exit t)) | ||
317 | |||
318 | (defhydra hydra-text-scale (:timeout 4) | ||
319 | "scale text" | ||
320 | ("j" text-scale-increase "in") | ||
321 | ("k" text-scale-decrease "out") | ||
322 | ("q" nil "finished" :exit t)) | ||
323 | |||
324 | (jd/leader-key-def | ||
325 | "tS" '(hydra-text-scale-global/body :which-key "Scale text") | ||
326 | "ts" '(hydra-text-scale/body :which-key "Scale text")) | ||
327 | |||
328 | #+end_src | ||
329 | |||
269 | ** Beacon | 330 | ** Beacon |
270 | 331 | ||
271 | #+begin_src emacs-lisp | 332 | #+begin_src emacs-lisp |
@@ -333,14 +394,34 @@ | |||
333 | :pin org | 394 | :pin org |
334 | :commands (org-capture org-agenda) | 395 | :commands (org-capture org-agenda) |
335 | :hook (org-mode . jd/org-mode-setup) | 396 | :hook (org-mode . jd/org-mode-setup) |
336 | :init | 397 | :config |
398 | (setq org-directory (file-truename "~/Documents/org/")) | ||
399 | (setq org-mobile-inbox-for-pull (concat org-directory "flagged.org")) | ||
400 | (setq org-mobile-directory "~/Dropbox/Apps/MobileOrg") | ||
401 | (setq org-agenda-files | ||
402 | '("Tasks.org")) | ||
337 | (setq org-ellipsis " ▾") | 403 | (setq org-ellipsis " ▾") |
338 | (setq org-agenda-start-with-log-mode t) | 404 | (setq org-agenda-start-with-log-mode t) |
339 | (setq org-log-done 'time) | 405 | (setq org-log-done 'time) |
340 | (setq org-log-into-drawer t) | 406 | (setq org-log-into-drawer t) |
341 | (setq org-return-follows-link t) | 407 | (setq org-return-follows-link t) |
342 | :config | 408 | (setq org-capture-templates |
343 | (menu-bar--display-line-numbers-mode-none) | 409 | `(("t" "Tasks / Projects") |
410 | ("tt" "Task" entry (file+olp "Tasks.org" "Inbox") | ||
411 | "* TODO %?\n %t\n %a\n %i" :empty-lines 1) | ||
412 | ("tT" "Task for tomorow" entry (file+olp "Tasks.org" "Inbox") | ||
413 | "* TODO %?\n %t\n SCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+1d\"))\n %a\n %i" :empty-lines 1) | ||
414 | |||
415 | ("m" "Metrics Capture") | ||
416 | ("mm" "Metrics" table-line (file+headline "Metrics.org" "Metrics") | ||
417 | "| %U | %^{Weight} | %^{Waist} | %^{Notes} |" :kill-buffer t))) | ||
418 | |||
419 | (setq org-latex-listings 'minted | ||
420 | org-latex-packages-alist '(("" "minted")) | ||
421 | org-latex-pdf-process | ||
422 | '("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f" | ||
423 | "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f")) | ||
424 | |||
344 | (require 'org-tempo)) | 425 | (require 'org-tempo)) |
345 | 426 | ||
346 | #+end_src | 427 | #+end_src |
@@ -350,11 +431,27 @@ | |||
350 | #+begin_src emacs-lisp | 431 | #+begin_src emacs-lisp |
351 | 432 | ||
352 | (jd/leader-key-def | 433 | (jd/leader-key-def |
353 | "o" '(:ignore t :which-key "Open") | 434 | "o" '(:ignore t :which-key "Open/Org") |
435 | "oc" '(org-capture :which-key "Open org-capture") | ||
436 | "oop" '(org-mobile-pull :which-key "Org mobile pull") | ||
437 | "ooP" '(org-mobile-push :which-key "Org mobile push") | ||
354 | "oa" '(org-agenda :which-key "Open org-agenda")) | 438 | "oa" '(org-agenda :which-key "Open org-agenda")) |
355 | 439 | ||
356 | #+end_src | 440 | #+end_src |
357 | 441 | ||
442 | ** Org evil | ||
443 | |||
444 | #+begin_src emacs-lisp | ||
445 | |||
446 | (use-package evil-org | ||
447 | :after org | ||
448 | :hook (org-mode . (lambda () evil-org-mode)) | ||
449 | :config | ||
450 | (require 'evil-org-agenda) | ||
451 | (evil-org-agenda-set-keys)) | ||
452 | |||
453 | #+end_src | ||
454 | |||
358 | ** Org make toc | 455 | ** Org make toc |
359 | 456 | ||
360 | #+begin_src emacs-lisp | 457 | #+begin_src emacs-lisp |
@@ -408,6 +505,8 @@ | |||
408 | #+begin_src emacs-lisp | 505 | #+begin_src emacs-lisp |
409 | 506 | ||
410 | (defun jd/org-tempo-setup () | 507 | (defun jd/org-tempo-setup () |
508 | (add-to-list 'org-structure-template-alist '("s" . "src")) | ||
509 | (add-to-list 'org-structure-template-alist '("sql" . "src sql")) | ||
411 | (add-to-list 'org-structure-template-alist '("sh" . "src sh")) | 510 | (add-to-list 'org-structure-template-alist '("sh" . "src sh")) |
412 | (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp")) | 511 | (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp")) |
413 | (add-to-list 'org-structure-template-alist '("li" . "src lisp")) | 512 | (add-to-list 'org-structure-template-alist '("li" . "src lisp")) |
@@ -423,6 +522,17 @@ | |||
423 | 522 | ||
424 | ** Org babel setup | 523 | ** Org babel setup |
425 | 524 | ||
525 | *** Load languages | ||
526 | |||
527 | #+begin_src emacs-lisp | ||
528 | |||
529 | (org-babel-do-load-languages | ||
530 | 'org-babel-load-languages | ||
531 | '((emacs-lisp . t) | ||
532 | (python . t))) | ||
533 | |||
534 | #+end_src | ||
535 | |||
426 | *** Auto tangle | 536 | *** Auto tangle |
427 | 537 | ||
428 | #+begin_src emacs-lisp | 538 | #+begin_src emacs-lisp |
@@ -469,6 +579,20 @@ | |||
469 | 579 | ||
470 | #+begin_src emacs-lisp | 580 | #+begin_src emacs-lisp |
471 | 581 | ||
582 | (defun jd/org-roam-filter-by-tag (tag-name) | ||
583 | (lambda (node) | ||
584 | (member tag-name (org-roam-node-tags node)))) | ||
585 | |||
586 | (defun jd/org-roam-list-notes-by-tag (tag-name) | ||
587 | (mapcar #'org-roam-node-file | ||
588 | (seq-filter | ||
589 | (jd/org-roam-filter-by-tag tag-name) | ||
590 | (org-roam-node-list)))) | ||
591 | |||
592 | (defun jd/org-roam-refreshagenda-list () | ||
593 | (interactive) | ||
594 | (setq org-agenda-files (org-roam-list-files))) | ||
595 | |||
472 | (use-package org-roam | 596 | (use-package org-roam |
473 | :custom | 597 | :custom |
474 | (org-roam-directory (file-truename "~/Documents/org/roam/")) | 598 | (org-roam-directory (file-truename "~/Documents/org/roam/")) |
@@ -479,6 +603,8 @@ | |||
479 | ("C-c n c" . org-roam-capture) | 603 | ("C-c n c" . org-roam-capture) |
480 | ;; Dailies | 604 | ;; Dailies |
481 | ("C-c n j" . org-roam-dailies-capture-today)) | 605 | ("C-c n j" . org-roam-dailies-capture-today)) |
606 | :bind-keymap | ||
607 | ("C-c n d" . org-roam-dailies-map) | ||
482 | :config | 608 | :config |
483 | ;; If you're using a vertical completion framework, you might want a more informative completion interface | 609 | ;; If you're using a vertical completion framework, you might want a more informative completion interface |
484 | (setq org-roam-node-display-template (concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag))) | 610 | (setq org-roam-node-display-template (concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag))) |
@@ -519,11 +645,77 @@ | |||
519 | 645 | ||
520 | (use-package python-mode | 646 | (use-package python-mode |
521 | :hook (python-mode . lsp-deferred) | 647 | :hook (python-mode . lsp-deferred) |
522 | :hook (python-mode . jd/python-mode-setup)) | 648 | :hook (python-mode . jd/python-mode-setup) |
649 | :config | ||
650 | (add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))) | ||
523 | 651 | ||
524 | (use-package pyvenv | 652 | (use-package pyvenv |
525 | :after python-mode) | 653 | :after python-mode) |
526 | 654 | ||
655 | (use-package django-mode | ||
656 | :config | ||
657 | ;; Remove all django-mode objects from auto-mode-alist | ||
658 | (while (rassq 'django-mode auto-mode-alist) | ||
659 | (let ((django-mode-object (rassq 'django-mode auto-mode-alist))) | ||
660 | (setq auto-mode-alist (delete django-mode-object auto-mode-alist))))) | ||
661 | |||
662 | #+end_src | ||
663 | |||
664 | *** Java | ||
665 | |||
666 | #+begin_src emacs-lisp | ||
667 | |||
668 | (use-package lsp-java | ||
669 | :config (add-hook 'java-mode-hook 'lsp)) | ||
670 | |||
671 | #+end_src | ||
672 | |||
673 | *** Type Script | ||
674 | |||
675 | #+begin_src emacs-lisp | ||
676 | |||
677 | (use-package typescript-mode | ||
678 | :config | ||
679 | (setq typescript-indent-level 2) | ||
680 | (add-to-list 'auto-mode-alist '("\\.tsx\\'" . typescript-mode))) | ||
681 | |||
682 | (use-package tide | ||
683 | :ensure t | ||
684 | :after (typescript-mode company) | ||
685 | :hook ((typescript-mode . tide-setup) | ||
686 | (typescript-mode . tide-hl-identifier-mode))) | ||
687 | |||
688 | (use-package flycheck | ||
689 | :ensure t | ||
690 | :hook ((after-init . global-flycheck-mode))) | ||
691 | |||
692 | #+end_src | ||
693 | |||
694 | *** Yaml | ||
695 | |||
696 | #+begin_src emacs-lisp | ||
697 | |||
698 | (use-package yaml-mode) | ||
699 | |||
700 | #+end_src | ||
701 | |||
702 | *** Docker | ||
703 | |||
704 | #+begin_src emacs-lisp | ||
705 | |||
706 | (use-package docker) | ||
707 | |||
708 | #+end_src | ||
709 | |||
710 | **** Keybinds | ||
711 | |||
712 | #+begin_src emacs-lisp | ||
713 | |||
714 | (jd/leader-key-def | ||
715 | "d" '(:ignore t :which-key "Docker") | ||
716 | "dc" '(docker-containers :which-key "Docker containers") | ||
717 | "dd" '(docker :which-key "Docker")) | ||
718 | |||
527 | #+end_src | 719 | #+end_src |
528 | 720 | ||
529 | ** Dap mode | 721 | ** Dap mode |
@@ -554,19 +746,21 @@ | |||
554 | 746 | ||
555 | #+begin_src emacs-lisp | 747 | #+begin_src emacs-lisp |
556 | 748 | ||
557 | (use-package company | 749 | (use-package company |
558 | :after lsp-mode | 750 | :after lsp-mode |
559 | :hook (lsp-mode . company-mode) | 751 | :hook (lsp-mode . company-mode) |
560 | :bind (:map company-active-map | 752 | :bind (:map company-active-map |
561 | ("<tab>" . company-complete-selection)) | 753 | ("<tab>" . company-complete-selection)) |
562 | (:map lsp-mode-map | 754 | (:map lsp-mode-map |
563 | ("<tab>" . company-indent-or-complete-common)) | 755 | ("<tab>" . company-indent-or-complete-common)) |
564 | :custom | 756 | :custom |
565 | (company-minimum-prefix-length 1) | 757 | (company-minimum-prefix-length 1) |
566 | (company-idle-delay 0.0)) | 758 | (company-idle-delay 0.0) |
759 | :config | ||
760 | (global-company-mode)) | ||
567 | 761 | ||
568 | (use-package company-box | 762 | (use-package company-box |
569 | :hook (company-mode . company-box-mode)) | 763 | :hook (company-mode . company-box-mode)) |
570 | 764 | ||
571 | #+end_src | 765 | #+end_src |
572 | 766 | ||
@@ -659,20 +853,23 @@ | |||
659 | #+end_src | 853 | #+end_src |
660 | 854 | ||
661 | * Apps | 855 | * Apps |
662 | |||
663 | ** Vterm | 856 | ** Vterm |
664 | 857 | ||
665 | #+begin_src emacs-lisp | 858 | #+begin_src emacs-lisp |
666 | 859 | ||
667 | (defun jd/open-new-vterm () | 860 | (defun jd/open-new-vterm (&optional jd/vterm-buffer-name) |
668 | (interactive) | 861 | (interactive) |
669 | (let ((buffer-name (generate-new-buffer-name vterm-buffer-name))) | 862 | (let ((buffer-name (generate-new-buffer-name vterm-buffer-name))) |
863 | (when jd/vterm-buffer-name | ||
864 | (setq buffer-name jd/vterm-buffer-name)) | ||
670 | (switch-to-buffer buffer-name) | 865 | (switch-to-buffer buffer-name) |
671 | (vterm-mode))) | 866 | (vterm-mode))) |
672 | 867 | ||
868 | |||
673 | (use-package vterm | 869 | (use-package vterm |
674 | :config | 870 | :config |
675 | (setq vterm-buffer-name "vterm")) | 871 | (setq vterm-buffer-name "vterm") |
872 | (evil-set-initial-state 'vterm-mode 'emacs)) | ||
676 | 873 | ||
677 | #+end_src | 874 | #+end_src |
678 | 875 | ||
@@ -714,13 +911,37 @@ | |||
714 | 911 | ||
715 | #+begin_src emacs-lisp | 912 | #+begin_src emacs-lisp |
716 | 913 | ||
717 | (use-package emms | 914 | (use-package emms |
718 | :config | 915 | :config |
719 | (require 'emms-setup) | 916 | (require 'emms-setup) |
720 | (emms-all) | 917 | (emms-all) |
721 | (emms-standard) | 918 | (emms-standard) |
722 | (emms-default-players) | 919 | (emms-default-players) |
723 | (emms-mode-line-disable) | 920 | (emms-mode-line-disable) |
724 | (emms-add-directory-tree "~/Documents/music/")) | 921 | ; (setq emms-info-functions '(emms-info-tinytag)) |
922 | (setq emms-browser-covers 'emms-browser-cache-thumbnail-async) | ||
923 | (setq emms-lyrics-dir "~/Documents/music/lyrics") | ||
924 | (emms-add-directory-tree "~/Documents/music/")) | ||
925 | |||
926 | #+end_src | ||
725 | 927 | ||
928 | ** PDF Tools | ||
929 | |||
930 | #+begin_src emacs-lisp | ||
931 | |||
932 | (use-package pdf-tools) | ||
933 | |||
934 | #+end_src | ||
935 | |||
936 | ** Mu4e | ||
937 | |||
938 | #+begin_src emacs-lisp | ||
939 | ;; Load my mu4e config | ||
940 | (require 'jd-mu4e) | ||
941 | #+end_src | ||
942 | |||
943 | * Runtime Performance | ||
944 | |||
945 | #+begin_src emacs-lisp | ||
946 | (setq gc-cons-threshold (* 2 1000 1000)) | ||
726 | #+end_src | 947 | #+end_src |