about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--init.el382
1 files changed, 207 insertions, 175 deletions
diff --git a/init.el b/init.el index 9423887..046fdc3 100644 --- a/init.el +++ b/init.el
@@ -42,31 +42,31 @@
42;; I don't want `visual-line-mode', because I really only want to wrap and 42;; I don't want `visual-line-mode', because I really only want to wrap and
43;; truncate lines. Believe me, I know what I'm doing. 43;; truncate lines. Believe me, I know what I'm doing.
44(acdw/set '((word-wrap t) 44(acdw/set '((word-wrap t)
45 (truncate-lines t))) 45 (truncate-lines t)))
46 46
47;; Whitespace 47;; Whitespace
48(acdw/set '((whitespace-style 48(acdw/set '((whitespace-style
49 (empty indentation space-before-tab space-after-tab)) 49 (empty indentation space-before-tab space-after-tab))
50 (indent-tabs-mode nil "We've lost this battle...") 50 (indent-tabs-mode nil "We've lost this battle...")
51 (tab-width 8))) 51 (tab-width 4)))
52(add-hook 'before-save-hook #'whitespace-cleanup) 52(add-hook 'before-save-hook #'whitespace-cleanup)
53 53
54;; Pairs 54;; Pairs
55(add-hook 'prog-mode-hook #'electric-pair-local-mode) 55(add-hook 'prog-mode-hook #'electric-pair-local-mode)
56(acdw/set '((show-paren-delay 0) 56(acdw/set '((show-paren-delay 0)
57 (show-paren-style mixed) 57 (show-paren-style mixed)
58 (show-paren-when-point-inside-paren t) 58 (show-paren-when-point-inside-paren t)
59 (show-paren-when-point-in-periphery t))) 59 (show-paren-when-point-in-periphery t)))
60(show-paren-mode +1) 60(show-paren-mode +1)
61 61
62;; Killing & Yanking 62;; Killing & Yanking
63(delete-selection-mode +1) 63(delete-selection-mode +1)
64(acdw/set '((save-interprogram-paste-before-kill t) 64(acdw/set '((save-interprogram-paste-before-kill t)
65 (yank-pop-change-selection t) 65 (yank-pop-change-selection t)
66 (x-select-enable-clipboard t) 66 (x-select-enable-clipboard t)
67 (x-select-enable-primary t) 67 (x-select-enable-primary t)
68 (mouse-drag-copy-region t) 68 (mouse-drag-copy-region t)
69 (kill-do-not-save-duplicates t))) 69 (kill-do-not-save-duplicates t)))
70 70
71;; Encoding 71;; Encoding
72(set-charset-priority 'unicode) 72(set-charset-priority 'unicode)
@@ -77,39 +77,39 @@
77(set-keyboard-coding-system 'utf-8-unix) 77(set-keyboard-coding-system 'utf-8-unix)
78(set-selection-coding-system 'utf-8-unix) 78(set-selection-coding-system 'utf-8-unix)
79(acdw/set '((locale-coding-system utf-8-unix) 79(acdw/set '((locale-coding-system utf-8-unix)
80 (coding-system-for-read utf-8-unix) 80 (coding-system-for-read utf-8-unix)
81 (coding-system-for-write utf-8-unix) 81 (coding-system-for-write utf-8-unix)
82 (buffer-file-coding-system utf-8-unix) 82 (buffer-file-coding-system utf-8-unix)
83 (org-export-coding-system utf-8-unix) 83 (org-export-coding-system utf-8-unix)
84 (org-html-coding-system utf-8-unix) 84 (org-html-coding-system utf-8-unix)
85 (default-process-coding-system (utf-8-unix . utf-8-unix)) 85 (default-process-coding-system (utf-8-unix . utf-8-unix))
86 (x-select-request-type (UTF8_STRING COMPOUND_TEXT TEXT STRING)))) 86 (x-select-request-type (UTF8_STRING COMPOUND_TEXT TEXT STRING))))
87 87
88;; Unique buffer names 88;; Unique buffer names
89(when (require 'uniquify) 89(when (require 'uniquify)
90 (acdw/set '((uniquify-buffer-name-style forward) 90 (acdw/set '((uniquify-buffer-name-style forward)
91 (uniquify-separator "/") 91 (uniquify-separator "/")
92 (uniquify-after-kill-buffer-p t) 92 (uniquify-after-kill-buffer-p t)
93 (uniquify-ignore-buffers-re "^\\*")))) 93 (uniquify-ignore-buffers-re "^\\*"))))
94 94
95;; Backups 95;; Backups
96(acdw/set `((backup-by-copying t) 96(acdw/set `((backup-by-copying t)
97 (delete-old-versions -1) 97 (delete-old-versions -1)
98 (version-control t) 98 (version-control t)
99 (vc-make-backup-files t) 99 (vc-make-backup-files t)
100 (backup-directory-alist ((".*" . ,(acdw/in-dir "backup/" t)))))) 100 (backup-directory-alist ((".*" . ,(acdw/in-dir "backup/" t))))))
101;; Autosaves 101;; Autosaves
102(acdw/set `((auto-save-file-name-transforms 102(acdw/set `((auto-save-file-name-transforms
103 ((".*" ,(acdw/in-dir "auto-save/" t) t))) 103 ((".*" ,(acdw/in-dir "auto-save/" t) t)))
104 (auto-save-list-file-prefix 104 (auto-save-list-file-prefix
105 ,(acdw/in-dir "auto-save-list/.saves-" t)))) 105 ,(acdw/in-dir "auto-save-list/.saves-" t))))
106(auto-save-visited-mode +1) 106(auto-save-visited-mode +1)
107 107
108(defun hook--auto-save-when-unfocused () 108(defun hook--auto-save-when-unfocused ()
109 "Save all buffers when out of focus." 109 "Save all buffers when out of focus."
110 (acdw/when-unfocused #'save-some-buffers t)) 110 (acdw/when-unfocused #'save-some-buffers t))
111(add-function :after after-focus-change-function 111(add-function :after after-focus-change-function
112 #'hook--auto-save-when-unfocused) 112 #'hook--auto-save-when-unfocused)
113 113
114;; Auto-revert 114;; Auto-revert
115(when (require 'autorevert) 115(when (require 'autorevert)
@@ -135,7 +135,7 @@
135 135
136;; Cursor 136;; Cursor
137(acdw/set '((cursor-type bar) 137(acdw/set '((cursor-type bar)
138 (cursor-in-non-selected-windows hollow))) 138 (cursor-in-non-selected-windows hollow)))
139 139
140(defun hook--overwrite-mode-change-cursor () 140(defun hook--overwrite-mode-change-cursor ()
141 (setq cursor-type (if overwrite-mode 'hbar 'bar))) 141 (setq cursor-type (if overwrite-mode 'hbar 'bar)))
@@ -143,113 +143,113 @@
143 143
144;; Scrolling 144;; Scrolling
145(acdw/set '((auto-window-vscroll nil) 145(acdw/set '((auto-window-vscroll nil)
146 (fast-but-imprecise-scrolling t) 146 (fast-but-imprecise-scrolling t)
147 (scroll-margin 0) 147 (scroll-margin 0)
148 (scroll-conservatively 101) 148 (scroll-conservatively 101)
149 (scroll-preserve-screen-position 1))) 149 (scroll-preserve-screen-position 1)))
150 150
151;; Bindings 151;; Bindings
152(acdw/binds (("C-h" ehelp-command :after ("ehelp" nil nil 'keymap)) 152(acdw/binds (("C-h" ehelp-command :after ("ehelp" nil nil 'keymap))
153 ([remap just-one-space] cycle-spacing) 153 ([remap just-one-space] cycle-spacing)
154 ("M-/" hippie-expand) 154 ("M-/" hippie-expand)
155 ("M-=" count-words) 155 ("M-=" count-words)
156 ("C-x C-b" ibuffer))) 156 ("C-x C-b" ibuffer)))
157 157
158;;; Startup 158;;; Startup
159(acdw/set `((inhibit-startup-screen t) 159(acdw/set `((inhibit-startup-screen t)
160 (initial-buffer-choice t) 160 (initial-buffer-choice t)
161 (initial-scratch-message 161 (initial-scratch-message
162 ,(concat ";; Howdy, " 162 ,(concat ";; Howdy, "
163 (nth 0 (split-string user-full-name)) "!" 163 (nth 0 (split-string user-full-name)) "!"
164 " Welcome to GNU Emacs.\n\n")))) 164 " Welcome to GNU Emacs.\n\n"))))
165 165
166;;; Minibuffer 166;;; Minibuffer
167 167
168(acdw/set '((minibuffer-prompt-properties (read-only t 168(acdw/set '((minibuffer-prompt-properties (read-only t
169 cursor-intangible t 169 cursor-intangible t
170 face minibuffer-prompt)) 170 face minibuffer-prompt))
171 (enable-recursive-minibuffers t) 171 (enable-recursive-minibuffers t)
172 (file-name-shadow-properties (invisible t)))) 172 (file-name-shadow-properties (invisible t))))
173(minibuffer-depth-indicate-mode +1) 173(minibuffer-depth-indicate-mode +1)
174(file-name-shadow-mode +1) 174(file-name-shadow-mode +1)
175 175
176;; Save history 176;; Save history
177(when (require 'savehist) 177(when (require 'savehist)
178 (acdw/set `((savehist-additional-variables 178 (acdw/set `((savehist-additional-variables
179 (kill-ring search-ring regexp-search-ring)) 179 (kill-ring search-ring regexp-search-ring))
180 (history-length t) 180 (history-length t)
181 (history-delete-duplicates t) 181 (history-delete-duplicates t)
182 (savehist-autosave-interval 6) 182 (savehist-autosave-interval 6)
183 (savehist-file ,(acdw/in-dir "savehist.el")))) 183 (savehist-file ,(acdw/in-dir "savehist.el"))))
184 (savehist-mode +1)) 184 (savehist-mode +1))
185 185
186;; Icomplete (-vertical) 186;; Icomplete (-vertical)
187(when (require 'icomplete) 187(when (require 'icomplete)
188 (acdw/set '((completion-ignore-case t) 188 (acdw/set '((completion-ignore-case t)
189 (read-buffer-completion-ignore-case t) 189 (read-buffer-completion-ignore-case t)
190 (icomplete-delay-completions-threshold 0) 190 (icomplete-delay-completions-threshold 0)
191 (icomplete-max-delay-chars 0) 191 (icomplete-max-delay-chars 0)
192 (icomplete-compute-delay 0) 192 (icomplete-compute-delay 0)
193 (icomplete-show-matches-on-no-input t) 193 (icomplete-show-matches-on-no-input t)
194 (icomplete-with-buffer-completion-tables t) 194 (icomplete-with-buffer-completion-tables t)
195 (icomplete-in-buffer t))) 195 (icomplete-in-buffer t)))
196 (acdw/pkg orderless 196 (acdw/pkg orderless
197 :set '((completion-styles (orderless)))) 197 :set '((completion-styles (orderless))))
198 (acdw/pkg icomplete-vertical 198 (acdw/pkg icomplete-vertical
199 :binds (("<down>" icomplete-forward-completions 199 :binds (("<down>" icomplete-forward-completions
200 :map icomplete-minibuffer-map) 200 :map icomplete-minibuffer-map)
201 ("C-n" icomplete-forward-completions 201 ("C-n" icomplete-forward-completions
202 :map icomplete-minibuffer-map) 202 :map icomplete-minibuffer-map)
203 ("<up>" icomplete-backward-completions 203 ("<up>" icomplete-backward-completions
204 :map icomplete-minibuffer-map) 204 :map icomplete-minibuffer-map)
205 ("C-p" icomplete-backward-completions 205 ("C-p" icomplete-backward-completions
206 :map icomplete-minibuffer-map) 206 :map icomplete-minibuffer-map)
207 ("C-v" icomplete-vertical-toggle 207 ("C-v" icomplete-vertical-toggle
208 :map icomplete-minibuffer-map)) 208 :map icomplete-minibuffer-map))
209 :now ((fido-mode -1) 209 :now ((fido-mode -1)
210 (icomplete-mode +1) 210 (icomplete-mode +1)
211 (icomplete-vertical-mode +1)))) 211 (icomplete-vertical-mode +1))))
212 212
213;; Consult 213;; Consult
214(acdw/pkg consult 214(acdw/pkg consult
215 :binds (;; C-c bindings (`mode-specific-map') 215 :binds (;; C-c bindings (`mode-specific-map')
216 ("C-c h" consult-history) 216 ("C-c h" consult-history)
217 ("C-c m" consult-mode-command) 217 ("C-c m" consult-mode-command)
218 ;; C-x bindings (`ctl-x-map') 218 ;; C-x bindings (`ctl-x-map')
219 ("C-x M-:" consult-complex-command) 219 ("C-x M-:" consult-complex-command)
220 ("C-x b" consult-buffer) 220 ("C-x b" consult-buffer)
221 ("C-x 4 b" consult-buffer-other-window) 221 ("C-x 4 b" consult-buffer-other-window)
222 ("C-x 5 b" consult-buffer-other-frame) 222 ("C-x 5 b" consult-buffer-other-frame)
223 ("C-x r x" consult-register) 223 ("C-x r x" consult-register)
224 ("C-x r b" consult-bookmark) 224 ("C-x r b" consult-bookmark)
225 ;; M-g bindings (`goto-map') 225 ;; M-g bindings (`goto-map')
226 ("M-g o" consult-outline) 226 ("M-g o" consult-outline)
227 ("M-g m" consult-mark) 227 ("M-g m" consult-mark)
228 ("M-g k" consult-global-mark) 228 ("M-g k" consult-global-mark)
229 ("M-g i" consult-imenu) 229 ("M-g i" consult-imenu)
230 ("M-g e" consult-error) 230 ("M-g e" consult-error)
231 ;; M-s bindings (`search-map') 231 ;; M-s bindings (`search-map')
232 ("M-s g" consult-grep) ; alts: 232 ("M-s g" consult-grep) ; alts:
233 ; consult-git-grep, 233 ; consult-git-grep,
234 ; consult-ripgrep 234 ; consult-ripgrep
235 ("M-s f" consult-find) ; alts: 235 ("M-s f" consult-find) ; alts:
236 ; consult-locate 236 ; consult-locate
237 ("M-s l" consult-line) 237 ("M-s l" consult-line)
238 ("M-s m" consult-multi-occur) 238 ("M-s m" consult-multi-occur)
239 ("M-s k" consult-keep-lines) 239 ("M-s k" consult-keep-lines)
240 ("M-s u" consult-focus-lines) 240 ("M-s u" consult-focus-lines)
241 ;; Other bindings 241 ;; Other bindings
242 ("M-y" consult-yank-pop) 242 ("M-y" consult-yank-pop)
243 ("<f1> a" consult-apropos) 243 ("<f1> a" consult-apropos)
244 ("C-h a" consult-apropos)) 244 ("C-h a" consult-apropos))
245 :now ((autoload 'consult-register-preview "consult")) 245 :now ((autoload 'consult-register-preview "consult"))
246 :set '((register-preview-delay 0) 246 :set '((register-preview-delay 0)
247 (register-preview-function #'consult-register-preview))) 247 (register-preview-function #'consult-register-preview)))
248 248
249;; Marginalia 249;; Marginalia
250(acdw/pkg marginalia 250(acdw/pkg marginalia
251 :set '((marginalia-annotators (marginalia-annotators-heavy 251 :set '((marginalia-annotators (marginalia-annotators-heavy
252 marginalia-annotators-light))) 252 marginalia-annotators-light)))
253 :now ((marginalia-mode +1))) 253 :now ((marginalia-mode +1)))
254 254
255;; Imenu 255;; Imenu
@@ -264,27 +264,27 @@
264;; Undo-fu 264;; Undo-fu
265(acdw/pkg undo-fu 265(acdw/pkg undo-fu
266 :binds (("C-/" undo-fu-only-undo) 266 :binds (("C-/" undo-fu-only-undo)
267 ("C-?" undo-fu-only-redo))) 267 ("C-?" undo-fu-only-redo)))
268(acdw/pkg undo-fu-session 268(acdw/pkg undo-fu-session
269 :set `((undo-fu-session-incompatible-files ("/COMMIT_EDITMSG\\'" 269 :set `((undo-fu-session-incompatible-files ("/COMMIT_EDITMSG\\'"
270 "/git-rebase-todo\\'")) 270 "/git-rebase-todo\\'"))
271 (undo-fu-session-directory ,(acdw/in-dir "undo/" t))) 271 (undo-fu-session-directory ,(acdw/in-dir "undo/" t)))
272 :then ((global-undo-fu-session-mode +1))) 272 :then ((global-undo-fu-session-mode +1)))
273 273
274;; Modus themes 274;; Modus themes
275(acdw/pkg (modus-themes 275(acdw/pkg (modus-themes
276 :host gitlab 276 :host gitlab
277 :repo "protesilaos/modus-themes") 277 :repo "protesilaos/modus-themes")
278 :set `((modus-themes-slanted-constructs t) 278 :set `((modus-themes-slanted-constructs t)
279 (modus-themes-bold-constructs t) 279 (modus-themes-bold-constructs t)
280 (modus-themes-region 'bg-only) 280 (modus-themes-region 'bg-only)
281 (modus-themes-org-blocks 'grayscale) 281 (modus-themes-org-blocks 'grayscale)
282 (modus-themes-headings ((1 . section) 282 (modus-themes-headings ((1 . section)
283 (t . no-color))) 283 (t . no-color)))
284 (modus-themes-scale-headings nil) 284 (modus-themes-scale-headings nil)
285 (modus-themes-mode-line nil)) 285 (modus-themes-mode-line nil))
286 :now ((acdw/sunrise-sunset #'modus-themes-load-operandi 286 :now ((acdw/sunrise-sunset #'modus-themes-load-operandi
287 #'modus-themes-load-vivendi))) 287 #'modus-themes-load-vivendi)))
288 288
289;; Expand-region 289;; Expand-region
290(acdw/pkg expand-region 290(acdw/pkg expand-region
@@ -293,12 +293,12 @@
293;; CRUX 293;; CRUX
294(acdw/pkg crux 294(acdw/pkg crux
295 :binds (("M-o" crux-other-window-or-switch-buffer) 295 :binds (("M-o" crux-other-window-or-switch-buffer)
296 ([remap move-beginning-of-line] crux-move-beginning-of-line) 296 ([remap move-beginning-of-line] crux-move-beginning-of-line)
297 ([remap kill-line] crux-kill-and-join-forward))) 297 ([remap kill-line] crux-kill-and-join-forward)))
298;;; Frame title 298;;; Frame title
299 299
300(acdw/set `((frame-title-format 300(acdw/set `((frame-title-format
301 "%b %+%* GNU Emacs"))) 301 "%b %+%* GNU Emacs")))
302 302
303;;; Mode line 303;;; Mode line
304 304
@@ -308,19 +308,19 @@
308;; Simple mode line 308;; Simple mode line
309(acdw/pkg simple-modeline 309(acdw/pkg simple-modeline
310 :set '((simple-modeline-segments 310 :set '((simple-modeline-segments
311 ((;; left 311 ((;; left
312 acdw-modeline/modified 312 acdw-modeline/modified
313 acdw-modeline/buffer-name 313 acdw-modeline/buffer-name
314 simple-modeline-segment-position 314 simple-modeline-segment-position
315 simple-modeline-segment-word-count) 315 simple-modeline-segment-word-count)
316 (;; right 316 (;; right
317 acdw-modeline/vc-branch 317 acdw-modeline/vc-branch
318 simple-modeline-segment-misc-info 318 simple-modeline-segment-misc-info
319 simple-modeline-segment-process 319 simple-modeline-segment-process
320 acdw-modeline/minions 320 acdw-modeline/minions
321 simple-modeline-segment-major-mode)))) 321 simple-modeline-segment-major-mode))))
322 :now ((require 'acdw-modeline) 322 :now ((require 'acdw-modeline)
323 (simple-modeline-mode +1))) 323 (simple-modeline-mode +1)))
324 324
325;;; Magit 325;;; Magit
326 326
@@ -330,75 +330,75 @@
330;;; Web browsing 330;;; Web browsing
331 331
332(acdw/set '((browse-url-browser-function browse-url-firefox) 332(acdw/set '((browse-url-browser-function browse-url-firefox)
333 (browse-url-new-window-flag t) 333 (browse-url-new-window-flag t)
334 (browse-url-firefox-new-window-is-tab t) 334 (browse-url-firefox-new-window-is-tab t)
335 (shr-max-width fill-column) 335 (shr-max-width fill-column)
336 (shr-width fill-column))) 336 (shr-width fill-column)))
337 337
338(when (eq acdw/system :work) 338(when (eq acdw/system :work)
339 (add-to-list 'exec-path "C:/Program Files/Mozilla Firefox")) 339 (add-to-list 'exec-path "C:/Program Files/Mozilla Firefox"))
340 340
341(acdw/hooks ((text-mode-hook goto-address-mode) 341(acdw/hooks ((text-mode-hook goto-address-mode)
342 (prog-mode-hook goto-address-prog-mode))) 342 (prog-mode-hook goto-address-prog-mode)))
343 343
344;;; Dired 344;;; Dired
345(acdw/pkg dired 345(acdw/pkg dired
346 :local t 346 :local t
347 :set `((dired-recursive-copies always) 347 :set `((dired-recursive-copies always)
348 (dired-recursive-deletes always) 348 (dired-recursive-deletes always)
349 (delete-by-moving-to-trash t) 349 (delete-by-moving-to-trash t)
350 (dired-listing-switches "-Al") 350 (dired-listing-switches "-Al")
351 (ls-lisp-dirs-first t) 351 (ls-lisp-dirs-first t)
352 (dired-dwim-target t)) 352 (dired-dwim-target t))
353 :now ((autoload 'dired-mode-map "dired" nil nil 'keymap) 353 :now ((autoload 'dired-mode-map "dired" nil nil 'keymap)
354 (acdw/pkg dired-subtree) 354 (acdw/pkg dired-subtree)
355 (acdw/pkg dired-x 355 (acdw/pkg dired-x
356 :local t 356 :local t
357 :binds (("C-x C-j" dired-jump))) 357 :binds (("C-x C-j" dired-jump)))
358 (acdw/pkg dired-collapse 358 (acdw/pkg dired-collapse
359 :hooks ((dired-mode-hook dired-collapse-mode))) 359 :hooks ((dired-mode-hook dired-collapse-mode)))
360 (defun hook--dired-mode () 360 (defun hook--dired-mode ()
361 (hl-line-mode +1) 361 (hl-line-mode +1)
362 (dired-hide-details-mode +1))) 362 (dired-hide-details-mode +1)))
363 :hooks ((dired-mode-hook hook--dired-mode)) 363 :hooks ((dired-mode-hook hook--dired-mode))
364 :binds (("i" dired-subtree-toggle :map dired-mode-map))) 364 :binds (("i" dired-subtree-toggle :map dired-mode-map)))
365 365
366;;; Eshell 366;;; Eshell
367 367
368(acdw/set `((eshell-directory-name ,(acdw/in-dir "eshell/" t)) 368(acdw/set `((eshell-directory-name ,(acdw/in-dir "eshell/" t))
369 (eshell-aliases-file ,(acdw/in-dir "eshell/aliases" t)))) 369 (eshell-aliases-file ,(acdw/in-dir "eshell/aliases" t))))
370 370
371;;; Org-mode 371;;; Org-mode
372(acdw/pkg (org 372(acdw/pkg (org
373 :repo "https://code.orgmode.org/bzg/org-mode.git") 373 :repo "https://code.orgmode.org/bzg/org-mode.git")
374 :now ((require 'acdw-org)) 374 :now ((require 'acdw-org))
375 :set `((org-directory "~/org") 375 :set `((org-directory "~/org")
376 (org-hide-emphasis-markers t) 376 (org-hide-emphasis-markers t)
377 (org-fontify-whole-heading-line t) 377 (org-fontify-whole-heading-line t)
378 (org-fontify-done-headline t) 378 (org-fontify-done-headline t)
379 (org-fontify-quote-and-verse-blocks t) 379 (org-fontify-quote-and-verse-blocks t)
380 (org-src-fontify-natively t) 380 (org-src-fontify-natively t)
381 (org-pretty-entities t) 381 (org-pretty-entities t)
382 (org-tags-column ,(- 0 fill-column -3)) 382 (org-tags-column ,(- 0 fill-column -3))
383 (org-src-tab-acts-natively t) 383 (org-src-tab-acts-natively t)
384 (org-src-window-setup current-window) 384 (org-src-window-setup current-window)
385 (org-confirm-babel-evaluate nil) 385 (org-confirm-babel-evaluate nil)
386 (org-adapt-indentation nil) 386 (org-adapt-indentation nil)
387 (org-catch-invisible-edits smart) 387 (org-catch-invisible-edits smart)
388 (org-special-ctrl-a/e t) 388 (org-special-ctrl-a/e t)
389 (org-special-ctrl-k t) 389 (org-special-ctrl-k t)
390 (org-imenu-depth 3) 390 (org-imenu-depth 3)
391 (org-export-headline-levels 8) 391 (org-export-headline-levels 8)
392 (org-export-with-smart-quotes t) 392 (org-export-with-smart-quotes t)
393 (org-export-with-sub-superscripts t)) 393 (org-export-with-sub-superscripts t))
394 :hooks ((before-save-hook acdw/hook--org-mode-fix-blank-lines)) 394 :hooks ((before-save-hook acdw/hook--org-mode-fix-blank-lines))
395 :binds (("RET" unpackaged/org-return-dwim 395 :binds (("RET" unpackaged/org-return-dwim
396 :map org-mode-map :map-after 'org))) 396 :map org-mode-map :map-after 'org)))
397 397
398;;; Nov.el -- ebook reader 398;;; Nov.el -- ebook reader
399(acdw/pkg nov 399(acdw/pkg nov
400 :now ((autoload #'nov-mode "nov") 400 :now ((autoload #'nov-mode "nov")
401 (add-to-list 'auto-mode-alist '("\\.epub\\'" . nov-mode))) 401 (add-to-list 'auto-mode-alist '("\\.epub\\'" . nov-mode)))
402 :set `((nov-text-width ,fill-column))) 402 :set `((nov-text-width ,fill-column)))
403 403
404;;; 0x0 -- upload files 404;;; 0x0 -- upload files
@@ -407,9 +407,41 @@
407 407
408;;; Programming languages 408;;; Programming languages
409 409
410;; General
411
412(acdw/pkg reformatter
413 :now ((require 'reformatter)))
414
415(acdw/set `((smie-indent-basic ,tab-width)))
416
417;; Shell(s)
418(when (executable-find "shellcheck")
419 (acdw/pkg flymake-shellcheck
420 :hooks ((sh-mode-hook (flymake-mode
421 flymake-shellcheck-load)))))
422
423(when (executable-find "shfmt")
424 (reformatter-define shfmt
425 :program "shfmt"
426 :lighter " Shfmt")
427 (defun hook--shfmt-on-save-saving-excursion ()
428 (save-excursion
429 (shfmt-buffer)))
430 (acdw/hooks ((sh-mode-hook hook--shfmt-on-save-saving-excursion))))
431
432(acdw/set `((sh-basic-offset ,tab-width)
433 (sh-indent-after-case 0)
434 (sh-indent-for-case-alt +)
435 (sh-indent-for-case-label 0)))
436
437(defun hook--sh-mode-indent-like-shfmt ()
438 "Try to mirror `shfmt' formatting in shell scripts."
439 (setq indent-tabs-mode t))
440(add-hook 'sh-mode-hook #'hook--sh-mode-indent-like-shfmt)
441
410;; Emacs lisp 442;; Emacs lisp
411(acdw/set '((eval-expression-print-length nil) 443(acdw/set '((eval-expression-print-length nil)
412 (eval-expression-print-level nil))) 444 (eval-expression-print-level nil)))
413 445
414(when (require 'cl-lib) 446(when (require 'cl-lib)
415 (setq-default lisp-indent-function #'common-lisp-indent-function) 447 (setq-default lisp-indent-function #'common-lisp-indent-function)
@@ -427,8 +459,8 @@
427;;; Miscellaneous 459;;; Miscellaneous
428 460
429(acdw/set '((disabled-command-function nil) 461(acdw/set '((disabled-command-function nil)
430 (load-prefer-newer t) 462 (load-prefer-newer t)
431 (comp-async-report-warnings-errors nil))) 463 (comp-async-report-warnings-errors nil)))
432 464
433(fset 'yes-or-no-p #'y-or-n-p) 465(fset 'yes-or-no-p #'y-or-n-p)
434 466
@@ -444,6 +476,6 @@
444(defun hook--gc-when-unfocused () 476(defun hook--gc-when-unfocused ()
445 (acdw/when-unfocused #'garbage-collect)) 477 (acdw/when-unfocused #'garbage-collect))
446(add-function :after after-focus-change-function 478(add-function :after after-focus-change-function
447 #'hook--gc-when-unfocused) 479 #'hook--gc-when-unfocused)
448 480
449;;; init.el ends here 481;;; init.el ends here