diff options
| author | 2025-03-09 22:02:22 +0200 | |
|---|---|---|
| committer | 2025-03-09 22:53:22 +0200 | |
| commit | 10a3be069d045894916b3dd1314916c9bfb34a34 (patch) | |
| tree | 8bf629945a3fb537dcb56eb60bb64625310b8755 | |
| parent | faces: Replace font with Input Mono (diff) | |
| download | emacs.d-10a3be069d045894916b3dd1314916c9bfb34a34.tar.gz emacs.d-10a3be069d045894916b3dd1314916c9bfb34a34.tar.xz emacs.d-10a3be069d045894916b3dd1314916c9bfb34a34.zip | |
files: Move to early configuration, incorporate top-level config
| -rw-r--r-- | init.el | 62 |
1 files changed, 32 insertions, 30 deletions
| @@ -25,9 +25,8 @@ | |||
| 25 | (defconst tmp-dir (expand-file-name "tmp" local-dir)) | 25 | (defconst tmp-dir (expand-file-name "tmp" local-dir)) |
| 26 | (defconst shared-dir (expand-file-name "shared" base-dir)) | 26 | (defconst shared-dir (expand-file-name "shared" base-dir)) |
| 27 | 27 | ||
| 28 | (setq auto-save-file-name-transforms `((".*" ,tmp-dir t)) | 28 | ;; Early configurations |
| 29 | backup-directory-alist `((".*" . ,tmp-dir)) | 29 | (setq custom-file (expand-file-name "custom.el" shared-dir) |
| 30 | custom-file (expand-file-name "custom.el" shared-dir) | ||
| 31 | shared-game-score-directory (expand-file-name "shared-game-score" shared-dir)) | 30 | shared-game-score-directory (expand-file-name "shared-game-score" shared-dir)) |
| 32 | 31 | ||
| 33 | (defun $adv-write-to-sane-paths (fn &rest args) | 32 | (defun $adv-write-to-sane-paths (fn &rest args) |
| @@ -38,7 +37,35 @@ | |||
| 38 | 37 | ||
| 39 | (advice-add #'enable-command :around #'$adv-write-to-sane-paths) | 38 | (advice-add #'enable-command :around #'$adv-write-to-sane-paths) |
| 40 | (advice-add #'disable-command :around #'$adv-write-to-sane-paths) | 39 | (advice-add #'disable-command :around #'$adv-write-to-sane-paths) |
| 41 | (advice-add #'locate-user-emacs-file :around #'$adv-write-to-sane-paths) | 40 | |
| 41 | (use-package files | ||
| 42 | :defer t | ||
| 43 | :custom | ||
| 44 | (auto-mode-case-fold nil) | ||
| 45 | (auto-save-file-name-transforms `((".*" ,tmp-dir t))) | ||
| 46 | (backup-directory-alist `((".*" . ,tmp-dir))) | ||
| 47 | (major-mode-remap-alist '((c-mode . c-ts-mode) | ||
| 48 | (c-or-c++-mode . c-or-c++-ts-mode) | ||
| 49 | (c++-mode . c++-ts-mode) | ||
| 50 | (cmake-mode . cmake-ts-mode) | ||
| 51 | (csharp-mode . csharp-ts-mode) | ||
| 52 | (css-mode . css-ts-mode) | ||
| 53 | (dockerfile-mode . dockerfile-ts-mode) | ||
| 54 | (go-mode . go-ts-mode) | ||
| 55 | (go-mod-mode . go-mod-ts-mode) | ||
| 56 | (html-mode . mhtml-mode) | ||
| 57 | (java-mode . java-ts-mode) | ||
| 58 | (js-mode . js-ts-mode) | ||
| 59 | (json-mode . json-ts-mode) | ||
| 60 | (python-mode . python-ts-mode) | ||
| 61 | (ruby-mode . ruby-ts-mode) | ||
| 62 | (rust-mode . rust-ts-mode) | ||
| 63 | (yaml-mode . yaml-ts-mode) | ||
| 64 | (toml-mode . toml-ts-mode) | ||
| 65 | (tsx-mode . tsx-ts-mode) | ||
| 66 | (typescript-mode . typescript-ts-mode))) | ||
| 67 | :config | ||
| 68 | (advice-add #'locate-user-emacs-file :around #'$adv-write-to-sane-paths)) | ||
| 42 | 69 | ||
| 43 | (when (file-exists-p custom-file) | 70 | (when (file-exists-p custom-file) |
| 44 | (load custom-file)) | 71 | (load custom-file)) |
| @@ -67,8 +94,6 @@ | |||
| 67 | (setq auth-sources (list (expand-file-name "authinfo.gpg" local-config-dir) | 94 | (setq auth-sources (list (expand-file-name "authinfo.gpg" local-config-dir) |
| 68 | "~/.authinfo.gpp")) | 95 | "~/.authinfo.gpp")) |
| 69 | 96 | ||
| 70 | ;; Force case sensitivity (if case insensitive, `auto-mode-alist` will be scanned twice). | ||
| 71 | (setq auto-mode-case-fold nil) | ||
| 72 | 97 | ||
| 73 | ;; Don't draw stuff in other windows. | 98 | ;; Don't draw stuff in other windows. |
| 74 | (setq-default cursor-in-non-selected-windows nil) | 99 | (setq-default cursor-in-non-selected-windows nil) |
| @@ -127,6 +152,7 @@ | |||
| 127 | (straight-freeze-versions)) | 152 | (straight-freeze-versions)) |
| 128 | 153 | ||
| 129 | ;; use-package | 154 | ;; use-package |
| 155 | ;; TODO: Check how to do add smth like `:advice (fn :around advice)` sometime | ||
| 130 | (use-package use-package) | 156 | (use-package use-package) |
| 131 | 157 | ||
| 132 | ;; compat | 158 | ;; compat |
| @@ -379,30 +405,6 @@ | |||
| 379 | ;; This actually has to be hooked to after-init to be one of the first minor modes enabled | 405 | ;; This actually has to be hooked to after-init to be one of the first minor modes enabled |
| 380 | :hook (after-init . envrc-global-mode)) | 406 | :hook (after-init . envrc-global-mode)) |
| 381 | 407 | ||
| 382 | (use-package files | ||
| 383 | :straight '(files :type built-in) | ||
| 384 | :custom | ||
| 385 | (major-mode-remap-alist '((c-mode . c-ts-mode) | ||
| 386 | (c-or-c++-mode . c-or-c++-ts-mode) | ||
| 387 | (c++-mode . c++-ts-mode) | ||
| 388 | (cmake-mode . cmake-ts-mode) | ||
| 389 | (csharp-mode . csharp-ts-mode) | ||
| 390 | (css-mode . css-ts-mode) | ||
| 391 | (dockerfile-mode . dockerfile-ts-mode) | ||
| 392 | (go-mode . go-ts-mode) | ||
| 393 | (go-mod-mode . go-mod-ts-mode) | ||
| 394 | (html-mode . mhtml-mode) | ||
| 395 | (java-mode . java-ts-mode) | ||
| 396 | (js-mode . js-ts-mode) | ||
| 397 | (json-mode . json-ts-mode) | ||
| 398 | (python-mode . python-ts-mode) | ||
| 399 | (ruby-mode . ruby-ts-mode) | ||
| 400 | (rust-mode . rust-ts-mode) | ||
| 401 | (yaml-mode . yaml-ts-mode) | ||
| 402 | (toml-mode . toml-ts-mode) | ||
| 403 | (tsx-mode . tsx-ts-mode) | ||
| 404 | (typescript-mode . typescript-ts-mode)))) | ||
| 405 | |||
| 406 | (use-package gcmh | 408 | (use-package gcmh |
| 407 | :straight t | 409 | :straight t |
| 408 | :custom | 410 | :custom |