diff options
author | jdlugosz963 <jdlugosz963@gmail.com> | 2022-10-04 18:43:56 +0200 |
---|---|---|
committer | jdlugosz963 <jdlugosz963@gmail.com> | 2022-10-04 18:43:56 +0200 |
commit | fc260cba25f032bd10687f5dd566766bd8160bce (patch) | |
tree | 09913f5616bfcb8d00a4e2c61088b089336a1dc3 /.config | |
parent | e91a46086812b7850c0bc462fbc86f467db26965 (diff) | |
download | dotfiles-fc260cba25f032bd10687f5dd566766bd8160bce.tar.gz dotfiles-fc260cba25f032bd10687f5dd566766bd8160bce.zip |
Update Emacs configuration files.
Diffstat (limited to '.config')
-rw-r--r-- | .config/emacs/init.el | 90 |
1 files changed, 31 insertions, 59 deletions
diff --git a/.config/emacs/init.el b/.config/emacs/init.el index f4df588..011d660 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el | |||
@@ -27,23 +27,23 @@ | |||
27 | (setq user-emacs-directory "~/.cache/emacs") | 27 | (setq user-emacs-directory "~/.cache/emacs") |
28 | 28 | ||
29 | (require 'package) | 29 | (require 'package) |
30 | (setq package-archives '(("melpa" . "https://melpa.org/packages/") | 30 | (setq package-archives '(("melpa" . "https://melpa.org/packages/") |
31 | ("org" . "https://orgmode.org/elpa/") | 31 | ("org" . "https://orgmode.org/elpa/") |
32 | ("gnu-devel" . "https://elpa.gnu.org/devel/") | 32 | ("gnu-devel" . "https://elpa.gnu.org/devel/") |
33 | ("elpa" . "https://elpa.gnu.org/packages/"))) | 33 | ("elpa" . "https://elpa.gnu.org/packages/"))) |
34 | (package-initialize) | 34 | (package-initialize) |
35 | 35 | ||
36 | (unless package-archive-contents | 36 | (unless package-archive-contents |
37 | (package-refresh-contents)) | 37 | (package-refresh-contents)) |
38 | 38 | ||
39 | (unless (package-installed-p 'use-package) | 39 | (unless (package-installed-p 'use-package) |
40 | (package-install 'use-package)) | 40 | (package-install 'use-package)) |
41 | 41 | ||
42 | (setq use-package-always-ensure t) | 42 | ;; (setq use-package-always-ensure t) |
43 | 43 | ||
44 | (require 'use-package) | 44 | (add-to-list 'load-path ".config/emacs/jd/") |
45 | 45 | ||
46 | (push ".config/emacs/jd/" load-path) | 46 | (require 'use-package) |
47 | 47 | ||
48 | (use-package general | 48 | (use-package general |
49 | :config | 49 | :config |
@@ -79,13 +79,6 @@ | |||
79 | :config | 79 | :config |
80 | (evil-collection-init)) | 80 | (evil-collection-init)) |
81 | 81 | ||
82 | (defhydra hydra-resize-window (:timeout 4) | ||
83 | ("h" evil-window-decrease-width "<") | ||
84 | ("l" evil-window-increase-width ">") | ||
85 | ("k" evil-window-decrease-height "^") | ||
86 | ("j" evil-window-increase-height "v") | ||
87 | ("q" nil "finished" :exit t)) | ||
88 | |||
89 | (jd/leader-key-def | 82 | (jd/leader-key-def |
90 | "w" 'evil-window-map | 83 | "w" 'evil-window-map |
91 | "wr" '(hydra-resize-window/body :which-key "Rezize window") | 84 | "wr" '(hydra-resize-window/body :which-key "Rezize window") |
@@ -185,6 +178,13 @@ | |||
185 | (let ((old-face-attribute (face-attribute 'default :height))) | 178 | (let ((old-face-attribute (face-attribute 'default :height))) |
186 | (set-face-attribute 'default nil :height (- old-face-attribute 10)))) | 179 | (set-face-attribute 'default nil :height (- old-face-attribute 10)))) |
187 | 180 | ||
181 | (defhydra hydra-resize-window (:timeout 4) | ||
182 | ("h" evil-window-decrease-width "<") | ||
183 | ("l" evil-window-increase-width ">") | ||
184 | ("k" evil-window-decrease-height "^") | ||
185 | ("j" evil-window-increase-height "v") | ||
186 | ("q" nil "finished" :exit t)) | ||
187 | |||
188 | (defhydra hydra-text-scale-global (:timeout 4) | 188 | (defhydra hydra-text-scale-global (:timeout 4) |
189 | "scale text" | 189 | "scale text" |
190 | ("j" jd/text-scale-increase "in") | 190 | ("j" jd/text-scale-increase "in") |
@@ -303,7 +303,7 @@ | |||
303 | (set-face-attribute (car face) nil :font "Monospace" :weight 'Bold :height (cdr face))) | 303 | (set-face-attribute (car face) nil :font "Monospace" :weight 'Bold :height (cdr face))) |
304 | 304 | ||
305 | ;; Ensure that anything that should be fixed-pitch in Org files appears that way | 305 | ;; Ensure that anything that should be fixed-pitch in Org files appears that way |
306 | (set-face-attribute 'org-block nil :font "mononoki Nerd Font" :inherit 'fixed-pitch) | 306 | ;; (set-face-attribute 'org-block nil :font "mononoki Nerd Font" :inherit 'fixed-pitch) |
307 | (set-face-attribute 'org-table nil :inherit 'fixed-pitch) | 307 | (set-face-attribute 'org-table nil :inherit 'fixed-pitch) |
308 | (set-face-attribute 'org-formula nil :inherit 'fixed-pitch) | 308 | (set-face-attribute 'org-formula nil :inherit 'fixed-pitch) |
309 | (set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch)) | 309 | (set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch)) |
@@ -405,26 +405,19 @@ | |||
405 | :after lsp) | 405 | :after lsp) |
406 | 406 | ||
407 | (defun jd/python-mode-setup () | 407 | (defun jd/python-mode-setup () |
408 | (let ((project-venv-path (concat (projectile-project-root) "venv/"))) | 408 | (let ((project-venv-path (concat (projectile-project-root) "venv/"))) |
409 | (when (projectile--directory-p project-venv-path) | 409 | (when (projectile--directory-p project-venv-path) |
410 | (pyvenv-activate project-venv-path) | 410 | (pyvenv-activate project-venv-path) |
411 | (pyvenv-mode)))) | 411 | (pyvenv-mode)))) |
412 | |||
413 | (use-package python-mode | ||
414 | :hook (python-mode . lsp-deferred) | ||
415 | :hook (python-mode . jd/python-mode-setup) | ||
416 | :config | ||
417 | (add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))) | ||
418 | 412 | ||
419 | (use-package pyvenv | 413 | ;; (use-package python-mode ;;TODO: find alternative |
420 | :after python-mode) | 414 | ;; :hook (python-mode . lsp-deferred) |
415 | ;; :hook (python-mode . jd/python-mode-setup) | ||
416 | ;; :config | ||
417 | ;; (add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))) | ||
421 | 418 | ||
422 | (use-package django-mode | 419 | (use-package pyvenv |
423 | :config | 420 | :after python-mode) |
424 | ;; Remove all django-mode objects from auto-mode-alist | ||
425 | (while (rassq 'django-mode auto-mode-alist) | ||
426 | (let ((django-mode-object (rassq 'django-mode auto-mode-alist))) | ||
427 | (setq auto-mode-alist (delete django-mode-object auto-mode-alist))))) | ||
428 | 421 | ||
429 | (use-package typescript-mode | 422 | (use-package typescript-mode |
430 | :mode ("\\.ts\\'") | 423 | :mode ("\\.ts\\'") |
@@ -438,15 +431,12 @@ | |||
438 | (tide-hl-identifier-mode))) | 431 | (tide-hl-identifier-mode))) |
439 | 432 | ||
440 | (use-package tide | 433 | (use-package tide |
441 | :ensure t | ||
442 | :after (typescript-mode company web-mode)) | 434 | :after (typescript-mode company web-mode)) |
443 | 435 | ||
444 | (use-package flycheck | 436 | (use-package flycheck |
445 | :ensure t | ||
446 | :hook ((after-init . global-flycheck-mode))) | 437 | :hook ((after-init . global-flycheck-mode))) |
447 | 438 | ||
448 | (use-package web-mode | 439 | (use-package web-mode |
449 | :ensure t | ||
450 | :hook ((web-mode . jd/activate-tide-mode)) | 440 | :hook ((web-mode . jd/activate-tide-mode)) |
451 | :mode | 441 | :mode |
452 | ("\\.ejs\\'" "\\.hbs\\'" "\\.html\\'" "\\.php\\'" "\\.[jt]sx?\\'") | 442 | ("\\.ejs\\'" "\\.hbs\\'" "\\.html\\'" "\\.php\\'" "\\.[jt]sx?\\'") |
@@ -471,24 +461,6 @@ | |||
471 | "dc" '(docker-containers :which-key "Docker containers") | 461 | "dc" '(docker-containers :which-key "Docker containers") |
472 | "dd" '(docker :which-key "Docker")) | 462 | "dd" '(docker :which-key "Docker")) |
473 | 463 | ||
474 | (use-package dap-mode | ||
475 | ;; Uncomment the config below if you want all UI panes to be hidden by default! | ||
476 | ;; :custom | ||
477 | ;; (lsp-enable-dap-auto-configure nil) | ||
478 | ;; :config | ||
479 | ;; (dap-ui-mode 1) | ||
480 | :commands dap-debug | ||
481 | :config | ||
482 | ;; Set up Node debugging | ||
483 | (require 'dap-node) | ||
484 | (dap-node-setup) ;; Automatically installs Node debug adapter if needed | ||
485 | |||
486 | ;; Bind `C-c l d` to `dap-hydra` for easy access | ||
487 | (general-define-key | ||
488 | :keymaps 'lsp-mode-map | ||
489 | :prefix lsp-keymap-prefix | ||
490 | "d" '(dap-hydra t :wk "debugger"))) | ||
491 | |||
492 | (use-package company | 464 | (use-package company |
493 | :after lsp-mode | 465 | :after lsp-mode |
494 | :hook (lsp-mode . company-mode) | 466 | :hook (lsp-mode . company-mode) |