diff options
Diffstat (limited to 'init.el')
-rw-r--r-- | init.el | 96 |
1 files changed, 71 insertions, 25 deletions
diff --git a/init.el b/init.el index 1a9c6a9..9c44e8b 100644 --- a/init.el +++ b/init.el | |||
@@ -117,12 +117,18 @@ | |||
117 | (add-hook 'user-save-hook #'+clean-empty-lines) | 117 | (add-hook 'user-save-hook #'+clean-empty-lines) |
118 | (user-save-global-mode +1)) | 118 | (user-save-global-mode +1)) |
119 | 119 | ||
120 | (setup (:require winner) | ||
121 | (winner-mode +1)) | ||
122 | |||
120 | (setup +key | 123 | (setup +key |
121 | (+ensure-after-init #'+key-global-mode)) | 124 | (+ensure-after-init #'+key-global-mode)) |
122 | 125 | ||
123 | (setup abbrev | 126 | (setup abbrev |
124 | (:option abbrev-file-name (sync/ "abbrev.el") | 127 | (:option abbrev-file-name (sync/ "abbrev.el") |
125 | save-abbrevs 'silent) | 128 | save-abbrevs 'silent) |
129 | (with-eval-after-load 'user-save | ||
130 | (:with-mode edit-abbrevs-mode | ||
131 | (:hook #'turn-off-user-save-mode))) | ||
126 | (:hook-into text-mode | 132 | (:hook-into text-mode |
127 | circe-chat-mode)) | 133 | circe-chat-mode)) |
128 | 134 | ||
@@ -471,7 +477,8 @@ | |||
471 | (:option notmuch-init-file (notmuch/ "notmuch-init.el" t) | 477 | (:option notmuch-init-file (notmuch/ "notmuch-init.el" t) |
472 | notmuch-address-save-filename (notmuch/ "addresses" t) | 478 | notmuch-address-save-filename (notmuch/ "addresses" t) |
473 | notmuch-address-use-company (featurep 'company) | 479 | notmuch-address-use-company (featurep 'company) |
474 | notmuch-search-oldest-first nil) | 480 | notmuch-search-oldest-first nil |
481 | notmuch-archive-tags '("-inbox" "-unread")) | ||
475 | ;; Composing mail | 482 | ;; Composing mail |
476 | (:option message-kill-buffer-on-exit t | 483 | (:option message-kill-buffer-on-exit t |
477 | message-auto-save-directory "~/var/mail/drafts") | 484 | message-auto-save-directory "~/var/mail/drafts") |
@@ -553,6 +560,9 @@ | |||
553 | ("+" . "-")) | 560 | ("+" . "-")) |
554 | org-log-done 'time | 561 | org-log-done 'time |
555 | org-log-into-drawer t | 562 | org-log-into-drawer t |
563 | org-num-skip-commented t | ||
564 | org-num-skip-unnumbered t | ||
565 | org-num-skip-footnotes t | ||
556 | org-outline-path-complete-in-steps nil | 566 | org-outline-path-complete-in-steps nil |
557 | org-pretty-entities t | 567 | org-pretty-entities t |
558 | org-pretty-entities-include-sub-superscripts nil | 568 | org-pretty-entities-include-sub-superscripts nil |
@@ -572,6 +582,7 @@ | |||
572 | (sequence "|" "CANCELED(k@)") | 582 | (sequence "|" "CANCELED(k@)") |
573 | (sequence "MEETING(m)") | 583 | (sequence "MEETING(m)") |
574 | (sequence "ASSIGNED(a@/!)" "REVIEW(r)" "|" "DONE(d!)")) | 584 | (sequence "ASSIGNED(a@/!)" "REVIEW(r)" "|" "DONE(d!)")) |
585 | org-use-speed-commands t | ||
575 | org-emphasis-alist '(("*" org-bold) | 586 | org-emphasis-alist '(("*" org-bold) |
576 | ("/" org-italic) | 587 | ("/" org-italic) |
577 | ("_" org-underline) | 588 | ("_" org-underline) |
@@ -611,9 +622,9 @@ | |||
611 | ;; complains about "Invalid face reference: t" in org-mode buffers, because | 622 | ;; complains about "Invalid face reference: t" in org-mode buffers, because |
612 | ;; `compose-region' returns t. | 623 | ;; `compose-region' returns t. |
613 | ("^ *\\([-]\\) " | 624 | ("^ *\\([-]\\) " |
614 | (0 (progn (compose-region (match-beginning 1) (match-end 1) "โ") 'default))) | 625 | (0 (progn (compose-region (match-beginning 1) (match-end 1) "โบ") 'default))) |
615 | ("^ *\\([+]\\) " | 626 | ("^ *\\([+]\\) " |
616 | (0 (progn (compose-region (match-beginning 1) (match-end 1) "โฆ") 'default))))) | 627 | (0 (progn (compose-region (match-beginning 1) (match-end 1) "ยป") 'default))))) |
617 | (with-eval-after-load 'form-feed | 628 | (with-eval-after-load 'form-feed |
618 | ;; Horizontal lines | 629 | ;; Horizontal lines |
619 | (font-lock-add-keywords | 630 | (font-lock-add-keywords |
@@ -714,6 +725,13 @@ | |||
714 | (with-eval-after-load 'user-save | 725 | (with-eval-after-load 'user-save |
715 | (advice-add 'org-export-dispatch :before 'user-save-run-hooks))) | 726 | (advice-add 'org-export-dispatch :before 'user-save-run-hooks))) |
716 | 727 | ||
728 | (setup org-id | ||
729 | (:load-after org) | ||
730 | ;; https://helpdeskheadesk.net/2022-03-13/ | ||
731 | (:option org-id-method 'ts | ||
732 | org-attach-id-to-path-function-list '(org-attach-id-ts-folder-format | ||
733 | org-attach-id-uuid-folder-format))) | ||
734 | |||
717 | (setup password-cache | 735 | (setup password-cache |
718 | (:option password-cache t | 736 | (:option password-cache t |
719 | password-cache-expiry (* 60 60))) | 737 | password-cache-expiry (* 60 60))) |
@@ -745,8 +763,9 @@ | |||
745 | tab-bar-tab-name-ellipsis truncate-string-ellipsis | 763 | tab-bar-tab-name-ellipsis truncate-string-ellipsis |
746 | tab-bar-show t | 764 | tab-bar-show t |
747 | tab-bar-close-button-show t | 765 | tab-bar-close-button-show t |
748 | +tab-bar-menu-bar-icon " โฐ " | 766 | tab-bar-new-button-show nil |
749 | tab-bar-close-button (propertize " ยฌ " | 767 | +tab-bar-menu-bar-icon " ; " |
768 | tab-bar-close-button (propertize "(x)" | ||
750 | 'display t | 769 | 'display t |
751 | 'close-tab t) | 770 | 'close-tab t) |
752 | tab-bar-new-button (propertize "+ " 'display t)) | 771 | tab-bar-new-button (propertize "+ " 'display t)) |
@@ -754,7 +773,7 @@ | |||
754 | (:option display-time-format "%H:%M" | 773 | (:option display-time-format "%H:%M" |
755 | display-time-mail-file :disable | 774 | display-time-mail-file :disable |
756 | display-time-load-average-threshold 50) | 775 | display-time-load-average-threshold 50) |
757 | (:option tab-bar-format '(+tab-bar-format-menu-bar | 776 | (:option tab-bar-format '(;;+tab-bar-format-menu-bar |
758 | tab-bar-format-history | 777 | tab-bar-format-history |
759 | tab-bar-format-tabs | 778 | tab-bar-format-tabs |
760 | tab-bar-separator | 779 | tab-bar-separator |
@@ -817,11 +836,13 @@ They are completed by \"M-x TAB\" only in Tramp debug buffers." | |||
817 | (and (executable-find "find") | 836 | (and (executable-find "find") |
818 | (executable-find "grep")))) | 837 | (executable-find "grep")))) |
819 | (:load-after consult orderless vertico) | 838 | (:load-after consult orderless vertico) |
820 | (setq affe-regexp-compiler | 839 | (setq affe-regexp-compiler (defun affe-orderless-regexp-compiler (input _type) |
821 | (defun affe-orderless-regexp-compiler (input &rest _) | 840 | (setq input (orderless-pattern-compiler input)) |
822 | (setq input (orderless-pattern-compiler input)) | 841 | (cons input (lambda (str) (orderless--highlight input str))))) |
823 | (cons input (lambda (str) (orderless--highlight input str))))) | 842 | (+with-eval-after-loads (affe vertico-multiform) |
824 | (with-eval-after-load 'affe | 843 | (setq affe-regexp-compiler (defun affe-orderless-regexp-compiler (input _type) |
844 | (setq input (orderless-pattern-compiler input)) | ||
845 | (cons input (lambda (str) (orderless--highlight input str))))) | ||
825 | (setf (alist-get 'affe-grep vertico-multiform-commands) '(buffer) | 846 | (setf (alist-get 'affe-grep vertico-multiform-commands) '(buffer) |
826 | (alist-get 'affe-find vertico-multiform-commands) '(buffer)) | 847 | (alist-get 'affe-find vertico-multiform-commands) '(buffer)) |
827 | (:+key "M-s g" #'affe-grep | 848 | (:+key "M-s g" #'affe-grep |
@@ -926,7 +947,7 @@ They are completed by \"M-x TAB\" only in Tramp debug buffers." | |||
926 | '(cape-file | 947 | '(cape-file |
927 | cape-dabbrev | 948 | cape-dabbrev |
928 | cape-keyword | 949 | cape-keyword |
929 | cape-abbrev | 950 | ;;cape-abbrev |
930 | cape-ispell | 951 | cape-ispell |
931 | ;;cape-dict | 952 | ;;cape-dict |
932 | )) | 953 | )) |
@@ -1100,6 +1121,11 @@ They are completed by \"M-x TAB\" only in Tramp debug buffers." | |||
1100 | 1121 | ||
1101 | (:with-mode tracking-mode | 1122 | (:with-mode tracking-mode |
1102 | (:option tracking-position 'before-modes) | 1123 | (:option tracking-position 'before-modes) |
1124 | (:bind "C-c C-SPC" (lambda () (interactive) | ||
1125 | (if (and (fboundp 'org-clocking-p) | ||
1126 | (org-clocking-p)) | ||
1127 | (message "Bro, get back to work!") | ||
1128 | (call-interactively #'tracking-next-buffer)))) | ||
1103 | (add-to-list 'mode-line-misc-info | 1129 | (add-to-list 'mode-line-misc-info |
1104 | '(tracking-mode | 1130 | '(tracking-mode |
1105 | tracking-mode-line-buffers))) | 1131 | tracking-mode-line-buffers))) |
@@ -1122,7 +1148,7 @@ They are completed by \"M-x TAB\" only in Tramp debug buffers." | |||
1122 | (setup (:straight clhs)) | 1148 | (setup (:straight clhs)) |
1123 | 1149 | ||
1124 | (setup (:straight consult) | 1150 | (setup (:straight consult) |
1125 | (:also-load +consult) | 1151 | (:require consult +consult) |
1126 | ;; from Consult wiki | 1152 | ;; from Consult wiki |
1127 | (:option register-preview-delay 0 | 1153 | (:option register-preview-delay 0 |
1128 | register-preview-function #'consult-register-format | 1154 | register-preview-function #'consult-register-format |
@@ -1352,7 +1378,8 @@ See also `crux-reopen-as-root-mode'." | |||
1352 | (:with-mode elfeed-search-mode | 1378 | (:with-mode elfeed-search-mode |
1353 | (:bind "&" #'+elfeed-search-browse-generic | 1379 | (:bind "&" #'+elfeed-search-browse-generic |
1354 | "w" #'elfeed-search-yank | 1380 | "w" #'elfeed-search-yank |
1355 | "y" nil) | 1381 | "y" nil |
1382 | "a" #'+elfeed-show-mark-read-and-advance) | ||
1356 | (:hook #'hl-line-mode) | 1383 | (:hook #'hl-line-mode) |
1357 | ;; https://old.reddit.com/r/emacs/comments/rlli0u/whats_your_favorite_defadvice/hphfh4e/ | 1384 | ;; https://old.reddit.com/r/emacs/comments/rlli0u/whats_your_favorite_defadvice/hphfh4e/ |
1358 | (advice-add #'elfeed-search-update--force :after #'elfeed-db-save) | 1385 | (advice-add #'elfeed-search-update--force :after #'elfeed-db-save) |
@@ -1367,7 +1394,8 @@ See also `crux-reopen-as-root-mode'." | |||
1367 | (:hook #'reading-mode) | 1394 | (:hook #'reading-mode) |
1368 | (:option +elfeed--update-repeat (* 60 30) ; 1/2 hour | 1395 | (:option +elfeed--update-repeat (* 60 30) ; 1/2 hour |
1369 | +elfeed--update-first-time 60)) | 1396 | +elfeed--update-first-time 60)) |
1370 | (+elfeed-update-async-mode +1)) | 1397 | (+elfeed-update-async-mode -1) ; It really messes with stuff for work |
1398 | ) | ||
1371 | 1399 | ||
1372 | (setup (:straight elfeed-org) | 1400 | (setup (:straight elfeed-org) |
1373 | (:also-load +org-capture) | 1401 | (:also-load +org-capture) |
@@ -1735,9 +1763,9 @@ See also `crux-reopen-as-root-mode'." | |||
1735 | (require 'modus-themes (.etc "straight/build/modus-themes/modus-themes")) | 1763 | (require 'modus-themes (.etc "straight/build/modus-themes/modus-themes")) |
1736 | (:also-load dawn) | 1764 | (:also-load dawn) |
1737 | (:option modus-themes-mixed-fonts t | 1765 | (:option modus-themes-mixed-fonts t |
1738 | modus-themes-bold-constructs t | 1766 | modus-themes-bold-constructs nil |
1739 | modus-themes-italic-constructs t | 1767 | modus-themes-italic-constructs t |
1740 | modus-themes-headings '((t . (background)))) | 1768 | modus-themes-headings '((t . (background regular rainbow)))) |
1741 | (dotimes (facen-1 8) | 1769 | (dotimes (facen-1 8) |
1742 | (let ((facen (1+ facen-1))) | 1770 | (let ((facen (1+ facen-1))) |
1743 | (custom-set-faces | 1771 | (custom-set-faces |
@@ -1746,6 +1774,8 @@ See also `crux-reopen-as-root-mode'." | |||
1746 | (,(intern (format "modus-themes-heading-%s" facen)) | 1774 | (,(intern (format "modus-themes-heading-%s" facen)) |
1747 | fixed-pitch)) | 1775 | fixed-pitch)) |
1748 | :now))))) | 1776 | :now))))) |
1777 | (:face modus-themes-tab-active ((t :bold nil)) | ||
1778 | modus-themes-tab-inactive ((t :italic t))) | ||
1749 | (dawn-schedule #'modus-themes-load-operandi | 1779 | (dawn-schedule #'modus-themes-load-operandi |
1750 | #'modus-themes-load-vivendi)) | 1780 | #'modus-themes-load-vivendi)) |
1751 | 1781 | ||
@@ -1862,6 +1892,9 @@ See also `crux-reopen-as-root-mode'." | |||
1862 | lisp-interaction-mode | 1892 | lisp-interaction-mode |
1863 | scheme-mode)) | 1893 | scheme-mode)) |
1864 | 1894 | ||
1895 | (setup (:straight pdf-tools) | ||
1896 | (pdf-tools-install)) | ||
1897 | |||
1865 | ;; (setup (:straight-when pdf-tools | 1898 | ;; (setup (:straight-when pdf-tools |
1866 | ;; ;; Ensure we can build `pdf-tools' | 1899 | ;; ;; Ensure we can build `pdf-tools' |
1867 | ;; (or (executable-find "gcc") | 1900 | ;; (or (executable-find "gcc") |
@@ -1905,11 +1938,17 @@ See also `crux-reopen-as-root-mode'." | |||
1905 | :host github :repo "gexplorer/simple-modeline" | 1938 | :host github :repo "gexplorer/simple-modeline" |
1906 | :fork (:host github :repo "duckwork/simple-modeline"))) | 1939 | :fork (:host github :repo "duckwork/simple-modeline"))) |
1907 | (:require +modeline) | 1940 | (:require +modeline) |
1908 | (:option +modeline-modified-icon-alist '((ephemeral . "๐ฅ") | 1941 | (:option +modeline-modified-icon-alist '((ephemeral . "~") |
1909 | (special . "๐ฅ") | 1942 | (special . "*") |
1910 | (readonly . "๐ฆ") | 1943 | (readonly . "=") |
1911 | (modified . "๐ฅช") | 1944 | (modified . "+") |
1912 | (t . "๐")) | 1945 | (t . "-")) |
1946 | ;; '((ephemeral . "๐ฅ") | ||
1947 | ;; (special . "๐ฅ") | ||
1948 | ;; (readonly . "๐ฆ") | ||
1949 | ;; (modified . "๐ฅช") | ||
1950 | ;; (t . "๐")) | ||
1951 | |||
1913 | +modeline-minions-icon ";" | 1952 | +modeline-minions-icon ";" |
1914 | simple-modeline-segments | 1953 | simple-modeline-segments |
1915 | `(( ; left | 1954 | `(( ; left |
@@ -1950,10 +1989,14 @@ See also `crux-reopen-as-root-mode'." | |||
1950 | slack-buffer-emojify t | 1989 | slack-buffer-emojify t |
1951 | slack-buffer-create-on-notify t | 1990 | slack-buffer-create-on-notify t |
1952 | slack-enable-wysiwyg t | 1991 | slack-enable-wysiwyg t |
1953 | slack-file-dir "~/var/download/" | 1992 | slack-file-dir (xdg-user-dir "DOWNLOAD") |
1954 | slack-display-team-name nil) | 1993 | slack-display-team-name nil) |
1955 | (with-eval-after-load '+slack | 1994 | (with-eval-after-load '+slack |
1956 | (+slack-register-teams))) | 1995 | (+slack-register-teams)) |
1996 | (with-eval-after-load 'alert | ||
1997 | ;; Don't notify for Slack messages | ||
1998 | (alert-add-rule :category "slack" | ||
1999 | :style 'ignore))) | ||
1957 | 2000 | ||
1958 | (setup (:straight-when sly | 2001 | (setup (:straight-when sly |
1959 | (defvar +lisp-bin (executable-find "sbcl"))) | 2002 | (defvar +lisp-bin (executable-find "sbcl"))) |
@@ -2055,6 +2098,9 @@ See also `crux-reopen-as-root-mode'." | |||
2055 | 2098 | ||
2056 | (setup (:straight unfill)) | 2099 | (setup (:straight unfill)) |
2057 | 2100 | ||
2101 | (setup (:straight valign) | ||
2102 | (:hook-into org-mode)) | ||
2103 | |||
2058 | (setup (:straight valign) (:quit "Doesn't work with narrowed tables.") | 2104 | (setup (:straight valign) (:quit "Doesn't work with narrowed tables.") |
2059 | (:option valign-fancy-bar t) | 2105 | (:option valign-fancy-bar t) |
2060 | (:hook-into org-mode | 2106 | (:hook-into org-mode |
@@ -2065,7 +2111,7 @@ See also `crux-reopen-as-root-mode'." | |||
2065 | :repo "minad/vertico" | 2111 | :repo "minad/vertico" |
2066 | :files ("*" "extensions/*" | 2112 | :files ("*" "extensions/*" |
2067 | (:exclude ".git")))) | 2113 | (:exclude ".git")))) |
2068 | (:also-load +vertico) | 2114 | (:require vertico +vertico) |
2069 | (:option resize-mini-windows 'grow-only | 2115 | (:option resize-mini-windows 'grow-only |
2070 | vertico-count-format nil | 2116 | vertico-count-format nil |
2071 | vertico-cycle t) | 2117 | vertico-cycle t) |