summary refs log tree commit diff stats
path: root/init.el
diff options
context:
space:
mode:
authorCase Duckworth2022-05-06 10:23:02 -0500
committerCase Duckworth2022-05-06 10:23:02 -0500
commitfcd47a9c3a10b6028045773ff5b197a080ac345c (patch)
tree0c01200c1a80723467fb43b7a7f6b97560eec6f9 /init.el
parentAdd +sort-lines (diff)
downloademacs-fcd47a9c3a10b6028045773ff5b197a080ac345c.tar.gz
emacs-fcd47a9c3a10b6028045773ff5b197a080ac345c.zip
meh
Diffstat (limited to 'init.el')
-rw-r--r--init.el121
1 files changed, 85 insertions, 36 deletions
diff --git a/init.el b/init.el index 4c0c4b0..206ba45 100644 --- a/init.el +++ b/init.el
@@ -14,6 +14,14 @@
14;; - Be kind to yourself. 14;; - Be kind to yourself.
15;; - Make good choices. 15;; - Make good choices.
16 16
17;;; Commentary
18
19;; My init.el. There are many like it, but this one is mine.
20
21;; Ideas:
22;; [[https://emacs.stackexchange.com/questions/17278/truncate-only-certain-lines-and-use-continuation-lines-elsewhere][Truncate org-mode headings]]
23;; [[https://emacs.stackexchange.com/questions/7432/make-visual-line-mode-more-compatible-with-org-mode][another link that might be useful for truncating]]
24
17;;; Code: 25;;; Code:
18 26
19(let ((early-features `((early-init . ,(locate-user-emacs-file "early-init")) 27(let ((early-features `((early-init . ,(locate-user-emacs-file "early-init"))
@@ -104,6 +112,8 @@
104 (:with-mode Custom-mode 112 (:with-mode Custom-mode
105 (:local-set imenu-generic-expression +cus-edit-imenu-generic-expression))) 113 (:local-set imenu-generic-expression +cus-edit-imenu-generic-expression)))
106 114
115(setup (:require find-script))
116
107(setup (:require goto-addr) 117(setup (:require goto-addr)
108 (if (fboundp #'global-goto-address-mode) 118 (if (fboundp #'global-goto-address-mode)
109 (global-goto-address-mode) 119 (global-goto-address-mode)
@@ -242,17 +252,15 @@
242 (:option +browse-url-transformations `((,(rx (or "youtube.com" 252 (:option +browse-url-transformations `((,(rx (or "youtube.com"
243 "youtu.be")) 253 "youtu.be"))
244 . ,+invidious-host) 254 . ,+invidious-host)
245 ("twitter\\.com" 255 ("twitter\\.com" . "nitter.net")
246 . "nitter.net") 256 ("instagram\\.com" . "bibilogram.art")
247 ("instagram\\.com"
248 . "bibilogram.art")
249 (,(rx (or "reddit.com" 257 (,(rx (or "reddit.com"
250 "old.reddit.com")) 258 "old.reddit.com"))
251 . "teddit.net") 259 . "teddit.net")
252 ("medium\\.com" 260 ("medium\\.com" . "scribe.rip")
253 . "scribe.rip") 261 ("www\\.npr\\.org" . "text.npr.org")
254 ("www\\.npr\\.org" 262 ;;TODO: Various paste sites
255 . "text.npr.org"))) 263 ))
256 (+browse-url-transform-url-global-mode +1)) 264 (+browse-url-transform-url-global-mode +1))
257 265
258(setup calendar 266(setup calendar
@@ -458,7 +466,8 @@
458 '(context-menu-ffap 466 '(context-menu-ffap
459 context-menu-region 467 context-menu-region
460 context-menu-undo 468 context-menu-undo
461 context-menu-dictionary)) 469 ;; context-menu-dictionary
470 ))
462 (context-menu-mode +1)) 471 (context-menu-mode +1))
463 (dolist (click '(;; Fix scrolling in the margin 472 (dolist (click '(;; Fix scrolling in the margin
464 wheel-down double-wheel-down triple-wheel-down 473 wheel-down double-wheel-down triple-wheel-down
@@ -467,9 +476,25 @@
467 (global-set-key (vector 'left-margin click) 'mwheel-scroll))) 476 (global-set-key (vector 'left-margin click) 'mwheel-scroll)))
468 477
469(setup net-utils 478(setup net-utils
479 (:needs "traceroute")
470 (:require +finger) ; fixes `finger' to use var below 480 (:require +finger) ; fixes `finger' to use var below
471 (:option finger-X.500-host-regexps '(".") ; only send username 481 (:option finger-X.500-host-regexps '(".") ; only send username
472 )) 482 )
483 (require 'transient)
484 (transient-define-prefix net-utils ()
485 "Networking utilities"
486 ["Actions"
487 ("p" "Ping" ping)
488 ("i" "Ifconfig" ifconfig)
489 ("w" "Iwconfig" iwconfig)
490 ("n" "Netstat" netstat)
491 ("a" "Arp" arp)
492 ("r" "Route" route)
493 ("h" "Nslookup host" nslookup-host)
494 ("d" "Dig" dig)
495 ("s" "Smb Client" smbclient)
496 ("t" "Traceroute" traceroute)])
497 (:+key "C-z M-n" #'net-utils))
473 498
474(setup notmuch 499(setup notmuch
475 (:load-from "~/usr/share/emacs/site-lisp/") 500 (:load-from "~/usr/share/emacs/site-lisp/")
@@ -558,7 +583,7 @@
558 org-fontify-done-headline t 583 org-fontify-done-headline t
559 org-fontify-quote-and-verse-blocks t 584 org-fontify-quote-and-verse-blocks t
560 org-fontify-whole-heading-line t 585 org-fontify-whole-heading-line t
561 org-hide-emphasis-markers t 586 org-hide-emphasis-markers nil
562 org-html-coding-system 'utf-8-unix 587 org-html-coding-system 'utf-8-unix
563 org-image-actual-width (list (* (window-font-width) 588 org-image-actual-width (list (* (window-font-width)
564 (- fill-column 8))) 589 (- fill-column 8)))
@@ -617,7 +642,15 @@
617 "C-c C-p" #'+org-previous-heading-widen 642 "C-c C-p" #'+org-previous-heading-widen
618 "C-c C-o" #'+org-open-at-point-dwim 643 "C-c C-o" #'+org-open-at-point-dwim
619 "`" #'+org-insert-tilde 644 "`" #'+org-insert-tilde
620 "~" #'+org-insert-backtick) 645 "~" #'+org-insert-backtick
646 "C-c C-x l" #'org-toggle-link-display
647 "C-c C-x m" (lambda () (interactive)
648 (setq-local org-hide-emphasis-markers
649 (not org-hide-emphasis-markers))
650 (font-lock-update))
651 "C-c C-x r" #'+org-drawer-list-add-resource
652 "C-M-k" #'kill-paragraph
653 "C-M-t" #'transpose-paragraphs)
621 (:global [f8] #'org-clock-in 654 (:global [f8] #'org-clock-in
622 [f9] #'org-clock-out 655 [f9] #'org-clock-out
623 "C-c l" #'org-store-link) 656 "C-c l" #'org-store-link)
@@ -629,6 +662,12 @@
629 (:local-set prettify-symbols-alist '(("DEADLINE:" . ?→) 662 (:local-set prettify-symbols-alist '(("DEADLINE:" . ?→)
630 ("SCHEDULED:" . ?↷) 663 ("SCHEDULED:" . ?↷)
631 ("CLOSED:" . ?✓)) 664 ("CLOSED:" . ?✓))
665 ;; electric-pair-pairs
666 ;; (append electric-pair-pairs
667 ;; (mapcar (lambda (emph)
668 ;; (let ((ch (string-to-char (car emph))))
669 ;; (cons ch ch)))
670 ;; org-emphasis-alist))
632 ;;+modeline-position-function #'+org-count-words-stupidly 671 ;;+modeline-position-function #'+org-count-words-stupidly
633 ) 672 )
634 (:local-hook user-save-hook #'+org-before-save@prettify-buffer) 673 (:local-hook user-save-hook #'+org-before-save@prettify-buffer)
@@ -646,6 +685,9 @@
646 (org-link-set-parameters "sms" :follow #'+org-sms-open) 685 (org-link-set-parameters "sms" :follow #'+org-sms-open)
647 (setf (alist-get "\\.x?html?\\'" org-file-apps nil nil #'equal) 686 (setf (alist-get "\\.x?html?\\'" org-file-apps nil nil #'equal)
648 #'+org-open-html)) 687 #'+org-open-html))
688 (:face 'org-done '((t (:inherit (modus-themes-subtle-green))))
689 'org-tag '((t (:inherit (secondary-selection))))
690 'org-todo '((t (:inherit (modus-themes-subtle-red)))))
649 ;; Extra keywords 691 ;; Extra keywords
650 (font-lock-add-keywords 692 (font-lock-add-keywords
651 'org-mode 693 'org-mode
@@ -1158,10 +1200,6 @@
1158 (:hook #'visual-line-mode 1200 (:hook #'visual-line-mode
1159 #'enable-lui-track 1201 #'enable-lui-track
1160 #'visual-fill-column-mode 1202 #'visual-fill-column-mode
1161 (defun +disable-electric-pair-mode ()
1162 "Disable `electric-pair-mode' in the current buffer."
1163 (interactive)
1164 (electric-pair-local-mode -1))
1165 #'enable-lui-autopaste) 1203 #'enable-lui-autopaste)
1166 (:local-set fringes-outside-margins t 1204 (:local-set fringes-outside-margins t
1167 right-margin-width (length lui-time-stamp-format) 1205 right-margin-width (length lui-time-stamp-format)
@@ -1178,6 +1216,7 @@
1178 (setf (alist-get 'lui-next-button-or-complete vertico-multiform-commands) 1216 (setf (alist-get 'lui-next-button-or-complete vertico-multiform-commands)
1179 '(flat)))) 1217 '(flat))))
1180 1218
1219 (tracking-mode +1)
1181 (:with-mode tracking-mode 1220 (:with-mode tracking-mode
1182 (:option tracking-position 'before-modes) 1221 (:option tracking-position 'before-modes)
1183 (:bind "C-c C-SPC" (lambda () (interactive) 1222 (:bind "C-c C-SPC" (lambda () (interactive)
@@ -1295,19 +1334,20 @@
1295 (with-eval-after-load 'vertico-multiform 1334 (with-eval-after-load 'vertico-multiform
1296 (setf (alist-get 'consult-buffer vertico-multiform-commands) '(flat)) 1335 (setf (alist-get 'consult-buffer vertico-multiform-commands) '(flat))
1297 (dolist (buf-cmd '(consult-find 1336 (dolist (buf-cmd '(consult-find
1298 consult-yank-pop 1337 consult-flymake
1299 consult-locate 1338 consult-focus-lines
1300 consult-grep
1301 consult-git-grep 1339 consult-git-grep
1302 consult-ripgrep 1340 consult-grep
1341 consult-imenu
1342 consult-imenu-multi
1343 consult-keep-lines
1303 consult-line 1344 consult-line
1304 consult-line-multi 1345 consult-line-multi
1346 consult-locate
1305 consult-multi-occur 1347 consult-multi-occur
1306 consult-keep-lines 1348 consult-outline
1307 consult-focus-lines 1349 consult-ripgrep
1308 consult-imenu 1350 consult-yank-pop))
1309 consult-imenu-multi
1310 consult-outline))
1311 (setf (alist-get buf-cmd vertico-multiform-commands) nil))))) 1351 (setf (alist-get buf-cmd vertico-multiform-commands) nil)))))
1312 1352
1313(setup (:straight consult-dir) 1353(setup (:straight consult-dir)
@@ -1505,6 +1545,11 @@
1505 (add-hook 'embark-collect-mode-hook #'consult-preview-at-point-mode)) 1545 (add-hook 'embark-collect-mode-hook #'consult-preview-at-point-mode))
1506 1546
1507(setup (:straight embrace) 1547(setup (:straight embrace)
1548 (dolist (mode '(LaTeX-mode org-mode ruby-mode))
1549 (add-hook (intern (format "%s-hook" mode))
1550 (intern (format "embrace-%s-hook" mode))))
1551 (:face 'embrace-help-pair-face '((t ( :inverse-video nil
1552 :inherit font-lock-keyword-face))))
1508 (:+key "C-," #'embrace-commander)) 1553 (:+key "C-," #'embrace-commander))
1509 1554
1510(setup (:straight (ement 1555(setup (:straight (ement
@@ -1611,7 +1656,7 @@
1611(setup (:straight (forge 1656(setup (:straight (forge
1612 :host github :repo "magit/forge") 1657 :host github :repo "magit/forge")
1613 (eq system-type 'gnu/linux)) 1658 (eq system-type 'gnu/linux))
1614 (require 'forge) 1659 (:quit) ; XXX: Somehow missing compat-26
1615 (add-to-list 'forge-alist 1660 (add-to-list 'forge-alist
1616 '("tildegit.org" "tildegit.org/api/v1" "tildegit.org" 1661 '("tildegit.org" "tildegit.org/api/v1" "tildegit.org"
1617 forge-gitea-repository))) 1662 forge-gitea-repository)))
@@ -1624,6 +1669,7 @@
1624(setup (:straight (frowny 1669(setup (:straight (frowny
1625 :host github 1670 :host github
1626 :repo "duckwork/frowny.el")) 1671 :repo "duckwork/frowny.el"))
1672 (:option frowny-eyes (rx (any ":=") (opt "'") (? "-")))
1627 (global-frowny-mode +1)) 1673 (global-frowny-mode +1))
1628 1674
1629(setup (:straight gcmh) 1675(setup (:straight gcmh)
@@ -1749,9 +1795,6 @@
1749 :fork ( :host nil 1795 :fork ( :host nil
1750 :repo "https://codeberg.org/acdw/emacs-jabber"))) 1796 :repo "https://codeberg.org/acdw/emacs-jabber")))
1751 (:also-load +jabber) 1797 (:also-load +jabber)
1752 (defvar +jabber-ws-prefix 0 "Width to pad left side of chats.")
1753 (defvar +jabber-pre-prompt " \n"
1754 "String to show before a prompt.")
1755 (:option jabber-account-list '(("acdw@hmm.st")) 1798 (:option jabber-account-list '(("acdw@hmm.st"))
1756 jabber-groupchat-buffer-format "%n" 1799 jabber-groupchat-buffer-format "%n"
1757 jabber-chat-buffer-format "%n" 1800 jabber-chat-buffer-format "%n"
@@ -1760,7 +1803,7 @@
1760 jabber-muc-decorate-presence-patterns 1803 jabber-muc-decorate-presence-patterns
1761 '(("\\( enters the room ([^)]+)\\| has left the chatroom\\)$") 1804 '(("\\( enters the room ([^)]+)\\| has left the chatroom\\)$")
1762 ("." . jabber-muc-presence-dim)) 1805 ("." . jabber-muc-presence-dim))
1763 jabber-muc-colorize-foreign t 1806 jabber-muc-colorize-foreign nil ; colorizing doesn't match my color theme
1764 jabber-chat-foreign-prompt-format (concat +jabber-pre-prompt 1807 jabber-chat-foreign-prompt-format (concat +jabber-pre-prompt
1765 "[%t] %n\n" 1808 "[%t] %n\n"
1766 (make-string +jabber-ws-prefix 1809 (make-string +jabber-ws-prefix
@@ -1794,7 +1837,6 @@
1794 jabber-console-mode)) 1837 jabber-console-mode))
1795 (let ((hook (intern (format "%s-hook" mode)))) 1838 (let ((hook (intern (format "%s-hook" mode))))
1796 (add-hook hook #'visual-fill-column-mode))) 1839 (add-hook hook #'visual-fill-column-mode)))
1797 (add-hook 'jabber-activity-mode-hook #'tracking-mode)
1798 (with-eval-after-load 'tracking 1840 (with-eval-after-load 'tracking
1799 (add-to-list 'tracking-ignored-buffers "discuss@conference.soprani.ca")) 1841 (add-to-list 'tracking-ignored-buffers "discuss@conference.soprani.ca"))
1800 (:with-mode jabber-chat-mode 1842 (:with-mode jabber-chat-mode
@@ -1888,6 +1930,7 @@
1888 1930
1889(setup (:straight mastodon) 1931(setup (:straight mastodon)
1890 (:option mastodon-instance-url "https://tiny.tilde.website" 1932 (:option mastodon-instance-url "https://tiny.tilde.website"
1933 mastodon-active-user "acdw"
1891 mastodon-client--token-file (.etc "mastodon.plstore") 1934 mastodon-client--token-file (.etc "mastodon.plstore")
1892 mastodon-auth-source-file (seq-some (lambda (i) 1935 mastodon-auth-source-file (seq-some (lambda (i)
1893 (when (and (stringp i) 1936 (when (and (stringp i)
@@ -2016,7 +2059,7 @@
2016 (:option completion-styles '(substring orderless basic) 2059 (:option completion-styles '(substring orderless basic)
2017 completion-category-defaults nil 2060 completion-category-defaults nil
2018 completion-category-overrides 2061 completion-category-overrides
2019 '((file (styles partial-completion)) 2062 '((file (styles basic partial-completion))
2020 (command (styles +orderless-with-initialism)) 2063 (command (styles +orderless-with-initialism))
2021 (variable (styles +orderless-with-initialism)) 2064 (variable (styles +orderless-with-initialism))
2022 (symbol (styles +orderless-with-initialism))) 2065 (symbol (styles +orderless-with-initialism)))
@@ -2056,6 +2099,7 @@
2056 (local-set-key (kbd "C-c M-o") 'org-mime-org-buffer-htmlize)))) 2099 (local-set-key (kbd "C-c M-o") 'org-mime-org-buffer-htmlize))))
2057 2100
2058(setup (:straight org-modern) 2101(setup (:straight org-modern)
2102 (:quit "I think I can do most of this myself.")
2059 (:option org-modern-hide-stars nil 2103 (:option org-modern-hide-stars nil
2060 org-modern-star nil 2104 org-modern-star nil
2061 org-modern-list nil 2105 org-modern-list nil
@@ -2081,7 +2125,9 @@
2081 (org-visibility-enable-hooks)) 2125 (org-visibility-enable-hooks))
2082 2126
2083(setup (:straight orglink) 2127(setup (:straight orglink)
2084 (global-orglink-mode +1)) 2128 (:option orglink-activate-in-modes '(text-mode prog-mode))
2129 (global-orglink-mode +1)
2130 (global-goto-address-mode -1))
2085 2131
2086(setup (:straight package-lint)) 2132(setup (:straight package-lint))
2087 2133
@@ -2126,7 +2172,7 @@
2126 (executable-find "g++"))) 2172 (executable-find "g++")))
2127 (setf (alist-get "\\.pdf\\'" auto-mode-alist nil nil #'equal) 2173 (setf (alist-get "\\.pdf\\'" auto-mode-alist nil nil #'equal)
2128 #'pdf-view-mode) 2174 #'pdf-view-mode)
2129 (pdf-tools-install)) 2175 (pdf-tools-install t))
2130 2176
2131(setup (:straight (plancat 2177(setup (:straight (plancat
2132 :host github 2178 :host github
@@ -2210,6 +2256,8 @@
2210 (:also-load +slack) 2256 (:also-load +slack)
2211 (:option slack-prefer-current-team t 2257 (:option slack-prefer-current-team t
2212 slack-buffer-emojify t 2258 slack-buffer-emojify t
2259 slack-thread-also-send-to-room nil
2260 slack-typing-visibility 'buffer
2213 slack-buffer-create-on-notify t 2261 slack-buffer-create-on-notify t
2214 slack-enable-wysiwyg t 2262 slack-enable-wysiwyg t
2215 slack-file-dir (xdg-user-dir "DOWNLOAD") 2263 slack-file-dir (xdg-user-dir "DOWNLOAD")
@@ -2243,7 +2291,8 @@
2243 (sophomore-enable #'narrow-to-region) 2291 (sophomore-enable #'narrow-to-region)
2244 (sophomore-disable ; These are mostly annoying commands 2292 (sophomore-disable ; These are mostly annoying commands
2245 #'view-hello-file 2293 #'view-hello-file
2246 #'describe-gnu-project) 2294 #'describe-gnu-project
2295 #'suspend-frame)
2247 (sophomore-mode +1)) 2296 (sophomore-mode +1))
2248 2297
2249(setup (:straight ssh-config-mode) 2298(setup (:straight ssh-config-mode)
@@ -2257,7 +2306,7 @@
2257(setup (:straight super-save) 2306(setup (:straight super-save)
2258 (:option auto-save-default nil 2307 (:option auto-save-default nil
2259 super-save-auto-save-when-idle t 2308 super-save-auto-save-when-idle t
2260 super-save-idle-duration 60 2309 super-save-idle-duration 30
2261 super-save-exclude '(".gpg") 2310 super-save-exclude '(".gpg")
2262 super-save-remote-files nil) 2311 super-save-remote-files nil)
2263 (auto-save-visited-mode -1) 2312 (auto-save-visited-mode -1)