diff options
Diffstat (limited to 'init.el')
-rw-r--r-- | init.el | 78 |
1 files changed, 40 insertions, 38 deletions
diff --git a/init.el b/init.el index 51bcf31..526c867 100644 --- a/init.el +++ b/init.el | |||
@@ -15,17 +15,13 @@ | |||
15 | ;; - Make good choices. | 15 | ;; - Make good choices. |
16 | 16 | ||
17 | ;;; Code: | 17 | ;;; Code: |
18 | 18 | (let ((early-features `((early-init . ,(locate-user-emacs-file "early-init")) | |
19 | (dolist (feature `((early-init . ,(locate-user-emacs-file "early-init")) | 19 | acdw private +key))) |
20 | acdw | 20 | (dolist (feature early-features) |
21 | private)) | 21 | (require (or (car-safe feature) feature) (cdr-safe feature) :noerror))) |
22 | (require (or (car-safe feature) feature) (cdr-safe feature) :noerror)) | ||
23 | 22 | ||
24 | (setup (:require +casing) | 23 | (setup (:require +casing) |
25 | (:+key "M-c" +casing-map) | 24 | (+casing-mode +1)) |
26 | ;; Unbind default casing bindings | ||
27 | (:global "M-u" nil "M-c" nil "M-l" nil | ||
28 | "C-x C-u" nil "C-x C-l" nil)) | ||
29 | 25 | ||
30 | (setup (:require +emacs) | 26 | (setup (:require +emacs) |
31 | ;; +emacs.el contains super-basic defaults that are basically necessary for | 27 | ;; +emacs.el contains super-basic defaults that are basically necessary for |
@@ -37,11 +33,8 @@ | |||
37 | (:global "C-x C-k" #'kill-current-buffer | 33 | (:global "C-x C-k" #'kill-current-buffer |
38 | "C-x 4 n" #'clone-buffer | 34 | "C-x 4 n" #'clone-buffer |
39 | "C-c v" #'visible-mode | 35 | "C-c v" #'visible-mode |
40 | "C-M-;" #'+lisp-comment-or-uncomment-sexp) | 36 | "C-M-;" #'+lisp-comment-or-uncomment-sexp |
41 | ;; Unbind stuff, too. | 37 | "M-j" nil) |
42 | (dolist (key '("C-M-j" | ||
43 | "M-j")) | ||
44 | (global-set-key (kbd key) nil)) | ||
45 | ;; C-h deletes backward - see https://idiomdrottning.org/bad-emacs-defaults | 38 | ;; C-h deletes backward - see https://idiomdrottning.org/bad-emacs-defaults |
46 | (global-set-key (kbd "C-h") 'delete-backward-char) | 39 | (global-set-key (kbd "C-h") 'delete-backward-char) |
47 | (keyboard-translate ?\C-h ?\C-?) | 40 | (keyboard-translate ?\C-h ?\C-?) |
@@ -55,15 +48,28 @@ | |||
55 | (:bind "C-c s" #'+init-sort-then-save) | 48 | (:bind "C-c s" #'+init-sort-then-save) |
56 | (:hook #'+init-add-setup-to-imenu)) | 49 | (:hook #'+init-add-setup-to-imenu)) |
57 | 50 | ||
58 | (setup (:require +key) | ||
59 | (+ensure-after-init #'+key-global-mode)) | ||
60 | |||
61 | (setup (:require +lookup) | 51 | (setup (:require +lookup) |
62 | (:+key "C-c l" +lookup-map)) | 52 | (+lookup-mode +1)) |
63 | 53 | ||
64 | (setup (:require auth-source) | 54 | (setup (:require auth-source) |
65 | (:option auth-sources (list (private/ "authinfo")))) | 55 | (:option auth-sources (list (private/ "authinfo")))) |
66 | 56 | ||
57 | (setup (:require auto-insert) | ||
58 | (setf (alist-get '("lisp/.*\\.el\\'" . "+Emacs lisp") | ||
59 | auto-insert-alist nil nil #'equal) | ||
60 | `(nil ";;; " (file-name-nondirectory (buffer-file-name)) | ||
61 | (make-string (max 2 (- fill-column (current-column) 27)) 32) | ||
62 | "-*- lexical-binding: t; -*-" '(setq lexical-binding t) | ||
63 | ,(concat "\n\n;;; Commentary:" | ||
64 | "\n\n;; ") _ | ||
65 | ,(concat "\n\n;;; Code:" | ||
66 | "\n\n" | ||
67 | "\n\n(provide '") | ||
68 | (file-name-base (buffer-file-name)) | ||
69 | ,(concat ")" "\n;;; ") | ||
70 | (file-name-nondirectory (buffer-file-name)) " ends here\n")) | ||
71 | (auto-insert-mode +1)) | ||
72 | |||
67 | (setup (:require cus-edit) | 73 | (setup (:require cus-edit) |
68 | ;; I don't use Custom to actually /make/ any customizations, but it's handy to | 74 | ;; I don't use Custom to actually /make/ any customizations, but it's handy to |
69 | ;; (A) see what options are available and (B) persist some changes across | 75 | ;; (A) see what options are available and (B) persist some changes across |
@@ -98,28 +104,15 @@ | |||
98 | (setup (:require reading) | 104 | (setup (:require reading) |
99 | (:global "C-c C-r" #'reading-mode)) | 105 | (:global "C-c C-r" #'reading-mode)) |
100 | 106 | ||
107 | (setup +key | ||
108 | (+ensure-after-init #'+key-global-mode)) | ||
109 | |||
101 | (setup abbrev | 110 | (setup abbrev |
102 | (:option abbrev-file-name (sync/ "abbrev.el") | 111 | (:option abbrev-file-name (sync/ "abbrev.el") |
103 | save-abbrevs 'silent) | 112 | save-abbrevs 'silent) |
104 | (:hook-into text-mode | 113 | (:hook-into text-mode |
105 | circe-chat-mode)) | 114 | circe-chat-mode)) |
106 | 115 | ||
107 | (setup auto-insert | ||
108 | (setf (alist-get '("lisp/.*\\.el\\'" . "+Emacs lisp") | ||
109 | auto-insert-alist nil nil #'equal) | ||
110 | `(nil ";;; " (file-name-nondirectory (buffer-file-name)) | ||
111 | (make-string (max 2 (- fill-column (current-column) 27)) 32) | ||
112 | "-*- lexical-binding: t; -*-" '(setq lexical-binding t) | ||
113 | ,(concat "\n\n;;; Commentary:" | ||
114 | "\n\n;; ") _ | ||
115 | ,(concat "\n\n;;; Code:" | ||
116 | "\n\n" | ||
117 | "\n\n(provide '") | ||
118 | (file-name-base (buffer-file-name)) | ||
119 | ,(concat ")" "\n;;; ") | ||
120 | (file-name-nondirectory (buffer-file-name)) " ends here\n")) | ||
121 | (auto-insert-mode +1)) | ||
122 | |||
123 | (setup autorevert | 116 | (setup autorevert |
124 | (:option global-auto-revert-non-file-buffers t | 117 | (:option global-auto-revert-non-file-buffers t |
125 | auto-revert-verbose nil) | 118 | auto-revert-verbose nil) |
@@ -303,6 +296,9 @@ | |||
303 | "M-n" nil | 296 | "M-n" nil |
304 | "M-p" nil)) | 297 | "M-p" nil)) |
305 | 298 | ||
299 | (setup flyspell | ||
300 | (:hook-into org-mode)) | ||
301 | |||
306 | (setup hideshow | 302 | (setup hideshow |
307 | (:also-load +hideshow) | 303 | (:also-load +hideshow) |
308 | (:with-mode hs-minor-mode | 304 | (:with-mode hs-minor-mode |
@@ -558,7 +554,7 @@ | |||
558 | [remap isearch-query-replace-regexp] #'anzu-isearch-query-replace-regexp)) | 554 | [remap isearch-query-replace-regexp] #'anzu-isearch-query-replace-regexp)) |
559 | 555 | ||
560 | (setup (:straight avy) | 556 | (setup (:straight avy) |
561 | (:also-load +avy) | 557 | (:require avy +avy) |
562 | (:+key "M-j" #'avy-goto-char-timer) | 558 | (:+key "M-j" #'avy-goto-char-timer) |
563 | (:bind-into isearch | 559 | (:bind-into isearch |
564 | "M-j" #'avy-isearch) | 560 | "M-j" #'avy-isearch) |
@@ -780,7 +776,7 @@ | |||
780 | ("M-s u" . consult-focus-lines) | 776 | ("M-s u" . consult-focus-lines) |
781 | ;; Isearch integration | 777 | ;; Isearch integration |
782 | ("M-s e" . consult-isearch-history))) | 778 | ("M-s e" . consult-isearch-history))) |
783 | (define-key +key-mode-map (kbd (car binding)) (cdr binding))) | 779 | (global-set-key (kbd (car binding)) (cdr binding))) |
784 | (with-eval-after-load 'isearch-mode | 780 | (with-eval-after-load 'isearch-mode |
785 | (dolist (binding '(("M-e" . consult-isearch-history) | 781 | (dolist (binding '(("M-e" . consult-isearch-history) |
786 | ("M-s e" . consult-isearch-history) | 782 | ("M-s e" . consult-isearch-history) |
@@ -813,7 +809,8 @@ | |||
813 | (setup (:straight crux) | 809 | (setup (:straight crux) |
814 | ;; yes it's silly I have an addon to this addon. | 810 | ;; yes it's silly I have an addon to this addon. |
815 | (:also-load +crux) | 811 | (:also-load +crux) |
816 | (:option crux-shell-func #'crux-eshell) | 812 | (:option crux-shell-func #'crux-eshell |
813 | +crux-default-date-format "%F") | ||
817 | (:global "C-o" #'crux-smart-open-line | 814 | (:global "C-o" #'crux-smart-open-line |
818 | "C-x 4 t" #'crux-transpose-windows | 815 | "C-x 4 t" #'crux-transpose-windows |
819 | "M-w" #'+crux-kill-ring-save | 816 | "M-w" #'+crux-kill-ring-save |
@@ -844,7 +841,7 @@ See also `crux-reopen-as-root-mode'." | |||
844 | (autoload 'dictionary-search "dictionary" | 841 | (autoload 'dictionary-search "dictionary" |
845 | "Ask for a word and search it in all dictionaries" t) | 842 | "Ask for a word and search it in all dictionaries" t) |
846 | (:hook #'reading-mode) | 843 | (:hook #'reading-mode) |
847 | (define-key +lookup-map "d" #'dictionary-search)) | 844 | (define-key +lookup-mode-map "d" #'dictionary-search)) |
848 | 845 | ||
849 | (setup (:straight (discord | 846 | (setup (:straight (discord |
850 | :host github | 847 | :host github |
@@ -949,6 +946,11 @@ See also `crux-reopen-as-root-mode'." | |||
949 | :repo "duckwork/filldent.el")) | 946 | :repo "duckwork/filldent.el")) |
950 | (:+key "M-q" #'filldent-dwim)) | 947 | (:+key "M-q" #'filldent-dwim)) |
951 | 948 | ||
949 | (setup (:straight flyspell-correct) | ||
950 | (:option flyspell-correct--cr-key ";") | ||
951 | (:bind-into flyspell | ||
952 | "C-;" #'flyspell-correct-wrapper)) | ||
953 | |||
952 | (setup (:straight-when (forge | 954 | (setup (:straight-when (forge |
953 | :host github :repo "magit/forge") | 955 | :host github :repo "magit/forge") |
954 | (eq system-system 'linux)) | 956 | (eq system-system 'linux)) |