summary refs log tree commit diff stats
path: root/init.el
diff options
context:
space:
mode:
authorCase Duckworth2023-01-14 19:14:24 -0600
committerCase Duckworth2023-01-14 19:14:24 -0600
commit2223dd66591aad1ee44916994c8782d5a59315d0 (patch)
tree50ed30832c247a023b22b038da3f27891cc0c2f9 /init.el
parentAdd +completions.el (diff)
downloademacs-2223dd66591aad1ee44916994c8782d5a59315d0.tar.gz
emacs-2223dd66591aad1ee44916994c8782d5a59315d0.zip
Whitespace etc.
Diffstat (limited to 'init.el')
-rw-r--r--init.el159
1 files changed, 86 insertions, 73 deletions
diff --git a/init.el b/init.el index f4eac89..f114adf 100644 --- a/init.el +++ b/init.el
@@ -9,58 +9,71 @@
9;;; Built-ins 9;;; Built-ins
10 10
11(use-package emacs ; Misc. config 11(use-package emacs ; Misc. config
12 :custom-face
13 (fixed-pitch ((t :family ,(find-font "Comic Code"
14 "DejaVu Sans Mono")
15 :height 100)))
16 (variable-pitch ((t :family ,(find-font "Atkinson Hyperlegible"
17 "DejaVu Serif")
18 :height 1.4)))
19 (default ((t :family ,(find-font "Comic Code"
20 "DejaVu Sans Mono")
21 :height 100)))
22 (font-lock-comment-face ((t :slant italic)))
23 :config 12 :config
24 (setopt tab-bar-show 1 13 (setopt tab-bar-show 1
25 recenter-positions '(top middle bottom)) 14 recenter-positions '(top middle bottom)
26 (keymap-global-unset "C-\\")) 15 initial-scratch-message
16 (mapconcat (lambda (s) (format ";; %s" s))
17 (process-lines "fortune")
18 "\n"))
19 (keymap-global-unset "C-\\")
20 (add-hook 'kill-buffer-query-functions
21 (defun scratch@immortal ()
22 (if (equal (buffer-name) "*scratch*")
23 (progn (bury-buffer) nil)
24 t))))
27 25
28(use-package faces 26(use-package faces
29 :defer 2 ; This is sort of expensive
30 :config 27 :config
31 ;; Emojis 28 (add-hook 'server-after-make-frame-hook
32 (cl-loop with ffl = (font-family-list) 29 (defun first-frame@set-fonts ()
33 for font in '("Noto Emoji" "Noto Color Emoji" 30 (face-spec-set 'fixed-pitch
34 "Segoe UI Emoji" "Apple Color Emoji" 31 `((t :family ,(find-font "Comic Code"
35 "FreeSans" "FreeMono" "FreeSerif" 32 "DejaVu Sans Mono")
36 "Unifont" "Symbola") 33 :height 100)))
37 if (member font ffl) 34 (face-spec-set 'variable-pitch
38 do (set-fontset-font t 'symbol font)) 35 `((t :family ,(find-font "Atkinson Hyperlegible"
39 ;; International scripts 36 "DejaVu Serif")
40 (cl-loop with ffl = (font-family-list) 37 :height 1.4)))
41 for (charset . font) in '((latin . "Noto Sans") 38 (face-spec-set 'default
42 (han . "Noto Sans CJK SC Regular") 39 `((t :family ,(find-font "Comic Code"
43 (kana . "Noto Sans CJK JP Regular") 40 "DejaVu Sans Mono")
44 (hangul . "Noto Sans CJK KR Regular") 41 :height 100)))
45 (cjk-misc . "Noto Sans CJK KR Regular") 42 (face-spec-set 'font-lock-comment-face
46 (khmer . "Noto Sans Khmer") 43 `((t :slant italic)))
47 (lao . "Noto Sans Lao") 44 ;; Emojis
48 (burmese . "Noto Sans Myanmar") 45 (cl-loop with ffl = (font-family-list)
49 (thai . "Noto Sans Thai") 46 for font in '("Noto Emoji" "Noto Color Emoji"
50 (ethiopic . "Noto Sans Ethiopic") 47 "Segoe UI Emoji" "Apple Color Emoji"
51 (hebrew . "Noto Sans Hebrew") 48 "FreeSans" "FreeMono" "FreeSerif"
52 (arabic . "Noto Sans Arabic") 49 "Unifont" "Symbola")
53 (gujarati . "Noto Sans Gujarati") 50 if (member font ffl)
54 (devanagari . "Noto Sans Devanagari") 51 do (set-fontset-font t 'symbol font))
55 (kannada . "Noto Sans Kannada") 52 ;; International scripts
56 (malayalam . "Noto Sans Malayalam") 53 (cl-loop with ffl = (font-family-list)
57 (oriya . "Noto Sans Oriya") 54 for (charset . font) in '((latin . "Noto Sans")
58 (sinhala . "Noto Sans Sinhala") 55 (han . "Noto Sans CJK SC Regular")
59 (tamil . "Noto Sans Tamil") 56 (kana . "Noto Sans CJK JP Regular")
60 (telugu . "Noto Sans Telugu") 57 (hangul . "Noto Sans CJK KR Regular")
61 (tibetan . "Noto Sans Tibetan")) 58 (cjk-misc . "Noto Sans CJK KR Regular")
62 if (member font ffl) 59 (khmer . "Noto Sans Khmer")
63 do (set-fontset-font t charset font))) 60 (lao . "Noto Sans Lao")
61 (burmese . "Noto Sans Myanmar")
62 (thai . "Noto Sans Thai")
63 (ethiopic . "Noto Sans Ethiopic")
64 (hebrew . "Noto Sans Hebrew")
65 (arabic . "Noto Sans Arabic")
66 (gujarati . "Noto Sans Gujarati")
67 (devanagari . "Noto Sans Devanagari")
68 (kannada . "Noto Sans Kannada")
69 (malayalam . "Noto Sans Malayalam")
70 (oriya . "Noto Sans Oriya")
71 (sinhala . "Noto Sans Sinhala")
72 (tamil . "Noto Sans Tamil")
73 (telugu . "Noto Sans Telugu")
74 (tibetan . "Noto Sans Tibetan"))
75 if (member font ffl)
76 do (set-fontset-font t charset font)))))
64 77
65(use-package text-mode 78(use-package text-mode
66 :config 79 :config
@@ -71,11 +84,11 @@
71 (add-hook 'prog-mode-hook #'auto-fill-mode) 84 (add-hook 'prog-mode-hook #'auto-fill-mode)
72 (add-hook 'prog-mode-hook 85 (add-hook 'prog-mode-hook
73 (defun prog@indent-tabs-maybe () 86 (defun prog@indent-tabs-maybe ()
74 (indent-tabs-mode 87 (indent-tabs-mode
75 (if (derived-mode-p 'emacs-lisp-mode 88 (if (derived-mode-p 'emacs-lisp-mode
76 'python-mode 89 'python-mode
77 'haskell-mode) 90 'haskell-mode)
78 -1 1))))) 91 -1 1)))))
79 92
80(use-package eshell 93(use-package eshell
81 :preface 94 :preface
@@ -201,15 +214,15 @@
201 :after custom-allowed 214 :after custom-allowed
202 :config 215 :config
203 (add-hook 'custom-allowed-after-load-hook 216 (add-hook 'custom-allowed-after-load-hook
204 (defun dawn-modus () 217 (defun dawn-modus ()
205 (dawn-schedule-themes 'modus-operandi 218 (dawn-schedule-themes 'modus-operandi
206 'modus-vivendi)))) 219 'modus-vivendi))))
207 220
208(use-package electric-cursor 221(use-package electric-cursor
209 :load-path "~/src/emacs/electric-cursor/" 222 :load-path "~/src/emacs/electric-cursor/"
210 :config 223 :config
211 (setopt electric-cursor-alist '((overwrite-mode . box) 224 (setopt electric-cursor-alist '((overwrite-mode . box)
212 (t . bar))) 225 (t . bar)))
213 (electric-cursor-mode)) 226 (electric-cursor-mode))
214 227
215(use-package mode-line-bell 228(use-package mode-line-bell
@@ -378,10 +391,10 @@ With prefix ARG, toggle the value of
378 (define-advice load-theme (:after (&rest _) mlscroll) 391 (define-advice load-theme (:after (&rest _) mlscroll)
379 (mlscroll-mode -1) 392 (mlscroll-mode -1)
380 (when (seq-intersection '(modus-vivendi modus-operandi) 393 (when (seq-intersection '(modus-vivendi modus-operandi)
381 custom-enabled-themes) 394 custom-enabled-themes)
382 (modus-themes-with-colors 395 (modus-themes-with-colors
383 (setq mlscroll-in-color fg-dim 396 (setq mlscroll-in-color fg-dim
384 mlscroll-out-color bg-inactive))) 397 mlscroll-out-color bg-inactive)))
385 (run-with-idle-timer 1 nil #'mlscroll-mode)) 398 (run-with-idle-timer 1 nil #'mlscroll-mode))
386 :config 399 :config
387 (load-theme@mlscroll)) 400 (load-theme@mlscroll))
@@ -399,8 +412,8 @@ With prefix ARG, toggle the value of
399 :config 412 :config
400 (setopt ws-butler-trim-predicate 413 (setopt ws-butler-trim-predicate
401 (lambda (begin end) 414 (lambda (begin end)
402 (not (eq 'font-lock-string-face 415 (not (eq 'font-lock-string-face
403 (get-text-property end 'face))))) 416 (get-text-property end 'face)))))
404 (ws-butler-global-mode)) 417 (ws-butler-global-mode))
405 418
406(use-package wgrep 419(use-package wgrep
@@ -408,16 +421,16 @@ With prefix ARG, toggle the value of
408 :config 421 :config
409 (setopt wgrep-enable-key (kbd "C-x C-q")) 422 (setopt wgrep-enable-key (kbd "C-x C-q"))
410 :bind (:map grep-mode-map 423 :bind (:map grep-mode-map
411 ("C-x C-q" . wgrep-change-to-wgrep-mode))) 424 ("C-x C-q" . wgrep-change-to-wgrep-mode)))
412 425
413(use-package avy 426(use-package avy
414 :ensure t 427 :ensure t
415 :init 428 :init
416 (setopt avy-background t 429 (setopt avy-background t
417 avy-keys (string-to-list "asdfghjklqwertyuiopzxcvbnm")) 430 avy-keys (string-to-list "asdfghjklqwertyuiopzxcvbnm"))
418 :bind (("M-j" . avy-goto-char-timer) 431 :bind (("M-j" . avy-goto-char-timer)
419 :map isearch-mode-map 432 :map isearch-mode-map
420 ("M-j" . avy-isearch))) 433 ("M-j" . avy-isearch)))
421 434
422(use-package zzz-to-char 435(use-package zzz-to-char
423 :ensure t 436 :ensure t
@@ -426,16 +439,16 @@ With prefix ARG, toggle the value of
426(use-package anzu 439(use-package anzu
427 :ensure t 440 :ensure t
428 :bind (("M-%" . anzu-query-replace-regexp) 441 :bind (("M-%" . anzu-query-replace-regexp)
429 ("C-M-%" . anzu-query-replace))) 442 ("C-M-%" . anzu-query-replace)))
430 443
431(use-package isearch-mb 444(use-package isearch-mb
432 :ensure t 445 :ensure t
433 :config 446 :config
434 (setopt isearch-lazy-count t 447 (setopt isearch-lazy-count t
435 isearch-regexp-lax-whitespace t 448 isearch-regexp-lax-whitespace t
436 search-whitespace-regexp "\\W+" 449 search-whitespace-regexp "\\W+"
437 search-default-mode t ; Search regexp by default 450 search-default-mode t ; Search regexp by default
438 isearch-wrap-pause 'no) 451 isearch-wrap-pause 'no)
439 (define-advice isearch-cancel (:before (&rest _) add-search-to-history) 452 (define-advice isearch-cancel (:before (&rest _) add-search-to-history)
440 "Add search string to history when canceling." 453 "Add search string to history when canceling."
441 (unless (equal "" isearch-string) 454 (unless (equal "" isearch-string)
@@ -444,11 +457,11 @@ With prefix ARG, toggle the value of
444 "Don't exit replace for any key that's not in `query-replace-map'." 457 "Don't exit replace for any key that's not in `query-replace-map'."
445 (save-window-excursion 458 (save-window-excursion
446 (cl-letf* ((lookup-key-orig (symbol-function 'lookup-key)) 459 (cl-letf* ((lookup-key-orig (symbol-function 'lookup-key))
447 ((symbol-function 'lookup-key) 460 ((symbol-function 'lookup-key)
448 (lambda (map key &optional accept-default) 461 (lambda (map key &optional accept-default)
449 (or (apply lookup-key-orig map key accept-default) 462 (or (apply lookup-key-orig map key accept-default)
450 (when (eq map query-replace-map) 'help))))) 463 (when (eq map query-replace-map) 'help)))))
451 (apply orig r)))) 464 (apply orig r))))
452 ;; Consult 465 ;; Consult
453 (autoload 'consult-line "consult" nil t) 466 (autoload 'consult-line "consult" nil t)
454 (autoload 'consult-isearch-history "consult" nil t) 467 (autoload 'consult-isearch-history "consult" nil t)