summary refs log tree commit diff stats
path: root/init.el
diff options
context:
space:
mode:
authorCase Duckworth2022-05-23 20:12:53 -0500
committerCase Duckworth2022-05-23 20:12:59 -0500
commitdd3afe747ecf51f87d33318c2ad68953d153495f (patch)
treec364d2c59741f68bb3f51e8a28f84a2a9712fd37 /init.el
parentAdd timers (diff)
downloademacs-dd3afe747ecf51f87d33318c2ad68953d153495f.tar.gz
emacs-dd3afe747ecf51f87d33318c2ad68953d153495f.zip
meh
Diffstat (limited to 'init.el')
-rw-r--r--init.el182
1 files changed, 120 insertions, 62 deletions
diff --git a/init.el b/init.el index 188ef6d..083678a 100644 --- a/init.el +++ b/init.el
@@ -45,8 +45,9 @@
45 "C-c v" #'visible-mode 45 "C-c v" #'visible-mode
46 "C-M-;" #'+lisp-comment-or-uncomment-sexp 46 "C-M-;" #'+lisp-comment-or-uncomment-sexp
47 "M-j" nil 47 "M-j" nil
48 "C-x o" (lambda () (interactive) (switch-to-buffer nil)) 48 "C-x C-o" #'+switch-to-last-buffer
49 "C-x C-o" #'+open-paragraph 49 "C-x o" #'+switch-to-last-buffer
50 "C-x C-l" #'+open-paragraph ; original: downcase-region
50 "C-w" #'+kill-word-backward-or-region 51 "C-w" #'+kill-word-backward-or-region
51 "C-x C-m" #'execute-extended-command ; original: coding systems 52 "C-x C-m" #'execute-extended-command ; original: coding systems
52 "C-<backspace>" #'+backward-kill-word 53 "C-<backspace>" #'+backward-kill-word
@@ -63,7 +64,7 @@
63 ;; Hooks 64 ;; Hooks
64 (add-hook 'prog-mode-hook #'turn-on-auto-fill) 65 (add-hook 'prog-mode-hook #'turn-on-auto-fill)
65 (add-hook 'prog-mode-hook #'font-lock-todo-insinuate) 66 (add-hook 'prog-mode-hook #'font-lock-todo-insinuate)
66 (add-hook 'text-mode-hook #'turn-on-auto-fill) 67 (add-hook 'text-mode-hook #'turn-on-auto-fill) ; XXX: do I want this ??
67 (add-hook 'special-mode-hook #'turn-off-auto-fill) 68 (add-hook 'special-mode-hook #'turn-off-auto-fill)
68 ;; Advice 69 ;; Advice
69 (advice-add #'completing-read-multiple :filter-args #'+crm-indicator) 70 (advice-add #'completing-read-multiple :filter-args #'+crm-indicator)
@@ -153,7 +154,7 @@
153 save-abbrevs 'silent) 154 save-abbrevs 'silent)
154 (with-eval-after-load 'user-save 155 (with-eval-after-load 'user-save
155 (:with-mode edit-abbrevs-mode 156 (:with-mode edit-abbrevs-mode
156 (:hook #'turn-off-user-save-mode))) 157 (:hook #'user-save-mode-disable)))
157 (:hook-into text-mode 158 (:hook-into text-mode
158 circe-chat-mode)) 159 circe-chat-mode))
159 160
@@ -293,7 +294,8 @@
293 dired-dwim-target t) 294 dired-dwim-target t)
294 (:local-set truncate-lines t) 295 (:local-set truncate-lines t)
295 (:bind "<backspace>" #'dired-up-directory 296 (:bind "<backspace>" #'dired-up-directory
296 "j" #'+dired-goto-file) 297 "j" #'+dired-goto-file
298 "C-j" #'dired-up-directory)
297 (:hook #'dired-hide-details-mode 299 (:hook #'dired-hide-details-mode
298 #'hl-line-mode 300 #'hl-line-mode
299 #'lin-mode 301 #'lin-mode
@@ -528,21 +530,33 @@
528 (advice-add 'notmuch-tag :filter-args #'+notmuch-correct-tags) 530 (advice-add 'notmuch-tag :filter-args #'+notmuch-correct-tags)
529 (:option notmuch-saved-searches (list 531 (:option notmuch-saved-searches (list
530 (list :name "inbox" 532 (list :name "inbox"
531 :query (+notmuch-query-concat "tag:inbox" 533 :query (+notmuch-query-concat
532 "NOT tag:Spam") 534 "tag:inbox"
535 "tag:unread"
536 "NOT tag:Spam")
533 :key "i") 537 :key "i")
534 (list :name "lists" 538 (list :name "lists"
535 :query (+notmuch-query-concat "tag:/List/" 539 :query (+notmuch-query-concat
536 "tag:unread") 540 "tag:/List/"
541 "tag:unread")
537 :key "l") 542 :key "l")
538 (list :name "unread" 543 (list :name "unread"
539 :query (+notmuch-query-concat "tag:unread" 544 :query (+notmuch-query-concat
540 "NOT tag:Spam") 545 "tag:unread"
546 "NOT tag:Spam")
541 :key "u") 547 :key "u")
542 (list :name "flagged" :query "tag:flagged" :key "f") 548 (list :name "flagged"
543 (list :name "sent" :query "tag:sent" :key "t") 549 :query "tag:flagged"
544 (list :name "drafts" :query "tag:draft" :key "d") 550 :key "f")
545 (list :name "all mail" :query "*" :key "a")))) 551 (list :name "sent"
552 :query "tag:sent"
553 :key "t")
554 (list :name "drafts"
555 :query "tag:draft"
556 :key "d")
557 (list :name "all mail"
558 :query "*"
559 :key "a"))))
546 (:+leader "m" #'+notmuch-goto "C-m" #'+notmuch-goto 560 (:+leader "m" #'+notmuch-goto "C-m" #'+notmuch-goto
547 "n" #'notmuch "C-n" #'notmuch) 561 "n" #'notmuch "C-n" #'notmuch)
548 ;; For `focus' 562 ;; For `focus'
@@ -582,7 +596,7 @@
582 org-confirm-babel-evaluate nil 596 org-confirm-babel-evaluate nil
583 org-cycle-separator-lines 0 597 org-cycle-separator-lines 0
584 org-directory (sync/ "org/" t) 598 org-directory (sync/ "org/" t)
585 org-ellipsis truncate-string-ellipsis 599 org-ellipsis (or truncate-string-ellipsis "…")
586 org-fontify-done-headline t 600 org-fontify-done-headline t
587 org-fontify-quote-and-verse-blocks t 601 org-fontify-quote-and-verse-blocks t
588 org-fontify-whole-heading-line t 602 org-fontify-whole-heading-line t
@@ -614,7 +628,7 @@
614 org-src-window-setup 'current-window 628 org-src-window-setup 'current-window
615 org-startup-truncated nil 629 org-startup-truncated nil
616 org-startup-with-inline-images t 630 org-startup-with-inline-images t
617 org-tags-column 1 ;; (- (- fill-column (length org-ellipsis))) 631 org-tags-column (- (- fill-column (length org-ellipsis)))
618 org-todo-keywords '((sequence "TODO(t)" "WAIT(w@/!)" "ONGOING(o@)" 632 org-todo-keywords '((sequence "TODO(t)" "WAIT(w@/!)" "ONGOING(o@)"
619 "|" "DONE(d!)") 633 "|" "DONE(d!)")
620 (sequence "|" "CANCELED(k@)") 634 (sequence "|" "CANCELED(k@)")
@@ -672,7 +686,6 @@
672 ;; (let ((ch (string-to-char (car emph)))) 686 ;; (let ((ch (string-to-char (car emph))))
673 ;; (cons ch ch))) 687 ;; (cons ch ch)))
674 ;; org-emphasis-alist)) 688 ;; org-emphasis-alist))
675 ;;+modeline-position-function #'+org-count-words-stupidly
676 ) 689 )
677 (:local-hook user-save-hook #'+org-before-save@prettify-buffer) 690 (:local-hook user-save-hook #'+org-before-save@prettify-buffer)
678 (advice-add #'org-delete-backward-char :override #'+org-delete-backward-char) 691 (advice-add #'org-delete-backward-char :override #'+org-delete-backward-char)
@@ -920,6 +933,11 @@
920 (widen) 933 (widen)
921 (string-equal (buffer-substring 1 10) ";; Emacs:"))))))) 934 (string-equal (buffer-substring 1 10) ";; Emacs:")))))))
922 935
936(setup whitespace
937 (:option whitespace-line-column nil
938 whitespace-style '(face trailing tabs tab-mark))
939 (:hook-into text-mode prog-mode))
940
923(setup (:straight 0x0) 941(setup (:straight 0x0)
924 (:option 0x0-default-server 'ttm) 942 (:option 0x0-default-server 'ttm)
925 (with-eval-after-load 'embark 943 (with-eval-after-load 'embark
@@ -986,7 +1004,8 @@
986 (:bind-into isearch 1004 (:bind-into isearch
987 "M-j" #'avy-isearch) 1005 "M-j" #'avy-isearch)
988 (:when-loaded 1006 (:when-loaded
989 (setf (alist-get ?. avy-dispatch-alist) #'avy-action-embark))) 1007 (setf (alist-get ?. avy-dispatch-alist) #'avy-action-embark)
1008 (+avy-buffer-face-mode +1)))
990 1009
991(setup (:straight bbdb) 1010(setup (:straight bbdb)
992 (:straight bbdb-vcard) 1011 (:straight bbdb-vcard)
@@ -1228,7 +1247,8 @@
1228 (:hook #'visual-line-mode 1247 (:hook #'visual-line-mode
1229 #'enable-lui-track 1248 #'enable-lui-track
1230 #'visual-fill-column-mode 1249 #'visual-fill-column-mode
1231 #'enable-lui-autopaste) 1250 #'enable-lui-autopaste
1251 )
1232 (:local-set fringes-outside-margins t 1252 (:local-set fringes-outside-margins t
1233 right-margin-width (length lui-time-stamp-format) 1253 right-margin-width (length lui-time-stamp-format)
1234 scroll-margin 0 1254 scroll-margin 0
@@ -1478,8 +1498,9 @@
1478(setup (:straight edit-server) 1498(setup (:straight edit-server)
1479 (:option edit-server-url-major-mode-alist `(("github\\.com" . ,(if (fboundp 'gfm-mode) 1499 (:option edit-server-url-major-mode-alist `(("github\\.com" . ,(if (fboundp 'gfm-mode)
1480 #'gfm-mode 1500 #'gfm-mode
1481 #'markdown-mode)))) 1501 #'markdown-mode))
1482 (add-hook 'edit-server-done-hook (lambda () (unfill-region (point-min) (point-max)))) 1502 ("reddit\\.com" . markdown-mode)
1503 ("notabug\\.org" . markdown-mode)))
1483 (+with-ensure-after-init 1504 (+with-ensure-after-init
1484 (edit-server-start))) 1505 (edit-server-start)))
1485 1506
@@ -1643,6 +1664,7 @@
1643(setup (:straight (fill-sentences-correctly 1664(setup (:straight (fill-sentences-correctly
1644 :host github 1665 :host github
1645 :repo "duckwork/fill-sentences-correctly.el")) 1666 :repo "duckwork/fill-sentences-correctly.el"))
1667 (:quit "I don't think this works like how I want.")
1646 (fill-sentences-correctly-mode +1)) 1668 (fill-sentences-correctly-mode +1))
1647 1669
1648(setup (:straight (filldent 1670(setup (:straight (filldent
@@ -2034,41 +2056,59 @@
2034 "Prog-mode major mode face.") 2056 "Prog-mode major mode face.")
2035 (modus-themes-with-colors 2057 (modus-themes-with-colors
2036 (custom-set-faces 2058 (custom-set-faces
2037 `(font-lock-builtin-face ((,class :inherit modus-themes-bold 2059 `(font-lock-builtin-face
2038 :foreground unspecified))) 2060 ((,class :inherit modus-themes-bold
2039 `(font-lock-comment-delimiter-face ((,class :inherit font-lock-comment-face))) 2061 :foreground unspecified)))
2040 `(font-lock-comment-face ((,class :inherit variable-pitch 2062 `(font-lock-comment-face
2041 :slant italic 2063 ((,class :inherit variable-pitch
2042 :foreground ,fg-docstring))) 2064 :foreground ,fg-comment-yellow)))
2043 `(font-lock-constant-face ((,class :inherit underline 2065 `(font-lock-comment-delimiter-face
2044 :foreground unspecified))) 2066 ((,class :inherit font-lock-comment-face)))
2045 `(font-lock-doc-face ((,class :inherit modus-themes-slant 2067 `(font-lock-constant-face
2046 :foreground ,fg-docstring))) 2068 ((,class :inherit underline
2047 `(font-lock-function-name-face ((,class :foreground unspecified))) 2069 :foreground unspecified)))
2048 `(font-lock-keyword-face ((,class :inherit modus-themes-bold 2070 `(font-lock-doc-face
2049 :foreground unspecified))) 2071 ((,class :inherit modus-themes-slant
2050 `(font-lock-negation-char-face ((,class :inherit modus-themes-bold 2072 :foreground ,fg-docstring)))
2051 :foreground unspecified))) 2073 `(font-lock-function-name-face
2052 `(font-lock-preprocessor-face ((,class :foreground unspecified))) 2074 ((,class :foreground unspecified
2053 `(font-lock-regexp-grouping-backslash ((,class :foreground ,fg-escape-char-backslash))) 2075 :slant italic)))
2054 `(font-lock-regexp-grouping-construct ((,class :foreground ,fg-escape-char-construct))) 2076 `(font-lock-keyword-face
2055 `(font-lock-string-face ((,class :inherit modus-themes-slant 2077 ((,class :inherit modus-themes-bold
2056 :foreground unspecified))) 2078 :foreground unspecified)))
2057 `(font-lock-type-face ((,class :inherit modus-themes-bold 2079 `(font-lock-negation-char-face
2058 :foreground unspecified))) 2080 ((,class :inherit modus-themes-bold
2059 `(font-lock-variable-name-face ((,class :foreground unspecified))) 2081 :foreground unspecified)))
2060 `(font-lock-warning-face ((,class :inherit modus-themes-bold 2082 `(font-lock-preprocessor-face
2061 :foreground ,red-nuanced-fg))) 2083 ((,class :foreground unspecified)))
2062 `(font-lock-todo-face ((,class :inherit font-lock-comment-face 2084 `(font-lock-regexp-grouping-backslash
2063 :foreground ,fg-header 2085 ((,class :foreground ,fg-escape-char-backslash)))
2064 :background ,yellow-intense-bg))) 2086 `(font-lock-regexp-grouping-construct
2065 `(+modeline-text-mode-face ((,class :foreground ,blue 2087 ((,class :foreground ,fg-escape-char-construct)))
2066 :inherit modus-themes-bold))) 2088 `(font-lock-string-face
2067 `(+modeline-prog-mode-face ((,class :foreground ,magenta 2089 ((,class :foreground ,fg-special-warm)))
2068 :inherit modus-themes-bold)))) 2090 `(font-lock-type-face
2069 (:option +modeline-major-mode-faces `((text-mode . +modeline-text-mode-face) 2091 ((,class :inherit modus-themes-bold
2070 (prog-mode . +modeline-prog-mode-face) 2092 :foreground unspecified)))
2071 (t . bold)))))) 2093 `(font-lock-variable-name-face
2094 ((,class :foreground unspecified)))
2095 `(font-lock-warning-face
2096 ((,class :inherit modus-themes-bold
2097 :foreground ,red-nuanced-fg)))
2098 `(font-lock-todo-face
2099 ((,class :inherit font-lock-comment-face
2100 :foreground ,fg-header
2101 :background ,yellow-intense-bg)))
2102 `(+modeline-text-mode-face
2103 ((,class :foreground ,blue
2104 :inherit modus-themes-bold)))
2105 `(+modeline-prog-mode-face
2106 ((,class :foreground ,magenta
2107 :inherit modus-themes-bold))))
2108 (:option +modeline-major-mode-faces
2109 `((text-mode . +modeline-text-mode-face)
2110 (prog-mode . +modeline-prog-mode-face)
2111 (t . bold))))))
2072 2112
2073 (require 'dawn) 2113 (require 'dawn)
2074 (dawn-schedule #'modus-themes-load-operandi 2114 (dawn-schedule #'modus-themes-load-operandi
@@ -2235,10 +2275,22 @@
2235(setup (:straight pdf-tools 2275(setup (:straight pdf-tools
2236 (or (executable-find "gcc") 2276 (or (executable-find "gcc")
2237 (executable-find "g++"))) 2277 (executable-find "g++")))
2278 (:also-load +pdf-tools)
2279 (:with-mode pdf-view-mode
2280 (:local-set +modeline-position-function #'+pdf-view-position))
2238 (setf (alist-get "\\.pdf\\'" auto-mode-alist nil nil #'equal) 2281 (setf (alist-get "\\.pdf\\'" auto-mode-alist nil nil #'equal)
2239 #'pdf-view-mode) 2282 #'pdf-view-mode)
2240 (pdf-tools-install :no-query)) 2283 (pdf-tools-install :no-query))
2241 2284
2285(setup (:straight persistent-scratch)
2286 (:require)
2287 (:option persistent-scratch-save-file (sync/ "emacs/scratch")
2288 persistent-scratch-backup-directory (sync/ "emacs/scratch.d/" t)
2289 persistent-scratch-backup-file-name-format "%Y-%m-%dT%H:%M_%s")
2290 (persistent-scratch-autosave-mode +1)
2291 (+mapc-some-buffers (lambda () (persistent-scratch-mode +1))
2292 persistent-scratch-scratch-buffer-p-function))
2293
2242(setup (:straight (plancat 2294(setup (:straight (plancat
2243 :host github 2295 :host github
2244 :repo "duckwork/plancat.el" 2296 :repo "duckwork/plancat.el"
@@ -2310,7 +2362,7 @@
2310 +modeline-narrowed 2362 +modeline-narrowed
2311 +modeline-text-scale 2363 +modeline-text-scale
2312 +modeline-input-method) 2364 +modeline-input-method)
2313 ",") 2365 " ")
2314 +modeline-major-mode 2366 +modeline-major-mode
2315 +modeline-spacer))) 2367 +modeline-spacer)))
2316 (simple-modeline-mode +1)) 2368 (simple-modeline-mode +1))
@@ -2356,12 +2408,14 @@
2356 #'view-hello-file 2408 #'view-hello-file
2357 #'describe-gnu-project 2409 #'describe-gnu-project
2358 #'suspend-frame) 2410 #'suspend-frame)
2411 (sophomore-disable-with 'confirm
2412 #'+save-buffers-quit
2413 #'save-buffers-kill-terminal)
2359 (sophomore-mode +1)) 2414 (sophomore-mode +1))
2360 2415
2361(setup (:straight (spongebob-case 2416(setup (:straight (spongebob-case
2362 :host github 2417 :host github
2363 :repo "duckwork/spongebob-case.el")) 2418 :repo "duckwork/spongebob-case.el")))
2364 (define-key +casing-map (kbd "M-s") #'spongebob-case-dwim))
2365 2419
2366(setup (:straight ssh-config-mode) 2420(setup (:straight ssh-config-mode)
2367 (:file-match (rx "/.ssh/config" eos) 2421 (:file-match (rx "/.ssh/config" eos)
@@ -2388,10 +2442,12 @@
2388 :host github 2442 :host github
2389 :repo "duckwork/titlecase.el" 2443 :repo "duckwork/titlecase.el"
2390 :files ("*"))) 2444 :files ("*")))
2391 (:require titlecase) 2445 (:require titlecase +titlecase)
2392 (:with-map +casing-map 2446 (:with-map +casing-map
2393 (:bind "t" #'titlecase-dwim 2447 (:bind "t" #'titlecase-dwim
2394 "M-t" #'titlecase-dwim))) 2448 "M-t" #'titlecase-dwim
2449 "s" #'+titlecase-sentence-style-dwim
2450 "M-s" #'+titlecase-sentence-style-dwim)))
2395 2451
2396(setup (:straight topsy) 2452(setup (:straight topsy)
2397 (:hook-into ;;prog-mode 2453 (:hook-into ;;prog-mode
@@ -2448,6 +2504,8 @@
2448 :host github 2504 :host github
2449 :repo "casouri/undo-hl")) 2505 :repo "casouri/undo-hl"))
2450 (:require) 2506 (:require)
2507 (:face 'undo-hl-delete '((t :strikethrough t))
2508 'undo-hl-insert '((t :underline t)))
2451 (:hook-into text-mode prog-mode)) 2509 (:hook-into text-mode prog-mode))
2452 2510
2453(setup (:straight unfill)) 2511(setup (:straight unfill))