summary refs log tree commit diff stats
path: root/init.el
diff options
context:
space:
mode:
authorCase Duckworth2021-10-06 19:17:00 -0500
committerCase Duckworth2021-10-06 19:17:00 -0500
commit79e4370571d9404a24600c211ed3822689d0ee0e (patch)
tree477dce9069cc0acf0570e9db8ce67e075d5fec7d /init.el
parentComment out define-repeat-map (diff)
parentStub a little further with chd/click-bits (diff)
downloademacs-79e4370571d9404a24600c211ed3822689d0ee0e.tar.gz
emacs-79e4370571d9404a24600c211ed3822689d0ee0e.zip
Merge branch 'main' of github.com:duckwork/.emacs.d
Diffstat (limited to 'init.el')
-rw-r--r--init.el135
1 files changed, 92 insertions, 43 deletions
diff --git a/init.el b/init.el index 0958bd9..6467bd9 100644 --- a/init.el +++ b/init.el
@@ -448,12 +448,10 @@
448 (:local-set outline-regexp eshell-prompt-regexp 448 (:local-set outline-regexp eshell-prompt-regexp
449 page-delimiter eshell-prompt-regexp) 449 page-delimiter eshell-prompt-regexp)
450 450
451 (:bind "C-d" #'eshell-quit-or-delete-char)
452
453 (:hook #'eshell-arg-hist-mode 451 (:hook #'eshell-arg-hist-mode
454 (defun eshell-mode@setup () 452 (defun eshell-mode@setup ()
455 (unless (bound-and-true-p eshell-customizations-loaded) 453 (require 'eshellrc (locate-user-emacs-file "eshell") :noerror)
456 (load (expand-file-name "eshell" user-emacs-directory)))))) 454 (:bind "C-d" #'eshell-quit-or-delete-char))))
457 455
458(setup eww 456(setup eww
459 (:also-load acdw-eww) 457 (:also-load acdw-eww)
@@ -682,9 +680,6 @@ specific to most general, they are these:
682 ;; <anything> -> mouse-1 /always/ follows link 680 ;; <anything> -> mouse-1 /always/ follows link
683 (:option mouse-1-click-follows-link t)) 681 (:option mouse-1-click-follows-link t))
684 682
685(setup mouse-avoidance
686 (mouse-avoidance-mode 'banish))
687
688(setup mu4e 683(setup mu4e
689 (:load-from "/usr/share/emacs/site-lisp/mu4e") 684 (:load-from "/usr/share/emacs/site-lisp/mu4e")
690 (:option mu4e-change-filenames-when-moving t 685 (:option mu4e-change-filenames-when-moving t
@@ -752,16 +747,21 @@ specific to most general, they are these:
752 pulse-delay 0.5 747 pulse-delay 0.5
753 pulse-iterations 1) 748 pulse-iterations 1)
754 749
755 (defun pulse-line (&rest _) 750 ;; XXX: this doesn't work yet. I only want to pulse the line in the active
756 "Pulse the current line." 751 ;; window, so when I have the same buffer viewed in multiple windows I can
757 (pulse-momentary-highlight-one-line (point))) 752 ;; still see where my cursor is. To see the issue, C-x 2 then C-x o a few
753 ;; times.
754 (defun pulse-line-current-window (&rest _)
755 "Pulse the current line, but only if this window is active."
756 (pulse-momentary-highlight-one-line (window-point (selected-window))))
758 757
759 (dolist (func '(scroll-up-command 758 (dolist (func '(scroll-up-command
760 scroll-down-command 759 scroll-down-command
761 recenter-top-bottom other-window 760 recenter-top-bottom
761 other-window
762 switch-to-buffer 762 switch-to-buffer
763 redraw-frame)) 763 redraw-frame))
764 (advice-add func :after #'pulse-line))) 764 (advice-add func :after #'pulse-line-current-window)))
765 765
766(setup re-builder 766(setup re-builder
767 (require 'acdw-re) 767 (require 'acdw-re)
@@ -993,6 +993,11 @@ specific to most general, they are these:
993 :repo "willvaughn/emacs-0x0")) 993 :repo "willvaughn/emacs-0x0"))
994 (:option 0x0-default-server 'ttm)) 994 (:option 0x0-default-server 'ttm))
995 995
996(setup (:straight (actually-selected-window
997 :host github
998 :repo "duckwork/actually-selected-window.el"))
999 (actually-selected-window-mode +1))
1000
996(setup (:straight-when affe 1001(setup (:straight-when affe
997 (and (or (executable-find "fd") 1002 (and (or (executable-find "fd")
998 (executable-find "find")) 1003 (executable-find "find"))
@@ -1091,8 +1096,9 @@ specific to most general, they are these:
1091 (with-eval-after-load 'circe 1096 (with-eval-after-load 'circe
1092 (:face circe-nick-highlight-face 1097 (:face circe-nick-highlight-face
1093 ((t (:inherit (modus-themes-hl-line modus-themes-bold)))) 1098 ((t (:inherit (modus-themes-hl-line modus-themes-bold))))
1094 circe-my-message-face 1099 ;; circe-my-message-face
1095 ((t (:inherit (modus-themes-slant)))))) 1100 ;; ((t (:inherit (modus-themes-slant))))
1101 ))
1096 1102
1097 (:bind "C-c C-p" #'circe-command-PART 1103 (:bind "C-c C-p" #'circe-command-PART
1098 "C-l" #'lui-track-jump-to-indicator 1104 "C-l" #'lui-track-jump-to-indicator
@@ -1243,7 +1249,7 @@ specific to most general, they are these:
1243 1249
1244(setup (:straight crux) 1250(setup (:straight crux)
1245 (:global "C-o" #'crux-smart-open-line 1251 (:global "C-o" #'crux-smart-open-line
1246 "M-o" #'crux-smart-open-line-above 1252 "M-o" #'open-paragraph
1247 "C-M-\\" #'crux-cleanup-buffer-or-region 1253 "C-M-\\" #'crux-cleanup-buffer-or-region
1248 "C-x 4 t" #'crux-transpose-windows) 1254 "C-x 4 t" #'crux-transpose-windows)
1249 1255
@@ -1393,9 +1399,6 @@ specific to most general, they are these:
1393 (defun elfeed@protocol-update (&rest _) 1399 (defun elfeed@protocol-update (&rest _)
1394 (elfeed-search-fetch nil))) 1400 (elfeed-search-fetch nil)))
1395 1401
1396 (:face message-header-subject
1397 ((t (:height 1.5))))
1398
1399 (:with-mode elfeed-show-mode 1402 (:with-mode elfeed-show-mode
1400 (:hook #'reading-mode) 1403 (:hook #'reading-mode)
1401 1404
@@ -1444,11 +1447,11 @@ specific to most general, they are these:
1444 ;; (t (apply fn url args)))) 1447 ;; (t (apply fn url args))))
1445 ) 1448 )
1446 1449
1447(setup (:straight-if emacs-everywhere 1450(setup (:straight-when emacs-everywhere
1448 (and (executable-find "xclip") 1451 (and (executable-find "xclip")
1449 (executable-find "xdotool") 1452 (executable-find "xdotool")
1450 (executable-find "xprop") 1453 (executable-find "xprop")
1451 (executable-find "xwininfo")))) 1454 (executable-find "xwininfo"))))
1452 1455
1453(setup (:straight (embark ; gotta git that fresh fresh 1456(setup (:straight (embark ; gotta git that fresh fresh
1454 :host github 1457 :host github
@@ -1851,6 +1854,15 @@ browser defined in `browse-url-secondary-browser-function'."
1851 (:option nov-text-width fill-column) 1854 (:option nov-text-width fill-column)
1852 (:file-match (rx ".epub" eos))) 1855 (:file-match (rx ".epub" eos)))
1853 1856
1857(setup (:straight (nyan-mode
1858 :host github :repo "TeMPOraL/nyan-mode"
1859 :fork (:host github :repo "duckwork/nyan-mode")
1860 :files ("nyan-mode.el" "img")))
1861 (:option nyan-animate-nyancat nil
1862 nyan-bar-length 20
1863 nyan-minimum-window-width fill-column)
1864 (nyan-mode +1))
1865
1854;; (setup (:straight olivetti) 1866;; (setup (:straight olivetti)
1855;; (:option olivetti-body-width (+ fill-column 4) 1867;; (:option olivetti-body-width (+ fill-column 4)
1856;; olivetti-minimum-body-width fill-column) 1868;; olivetti-minimum-body-width fill-column)
@@ -1942,7 +1954,7 @@ browser defined in `browse-url-secondary-browser-function'."
1942 org-clock-clocked-in-display 'mode-line 1954 org-clock-clocked-in-display 'mode-line
1943 org-clock-frame-title-format (cons '(t org-mode-line-string) 1955 org-clock-frame-title-format (cons '(t org-mode-line-string)
1944 (cons " --- " frame-title-format)) 1956 (cons " --- " frame-title-format))
1945 ;;org-clock-string-limit 7 ; gives time and not title 1957 org-clock-string-limit 25 ; gives enough information
1946 org-clock-persist t 1958 org-clock-persist t
1947 org-confirm-babel-evaluate nil 1959 org-confirm-babel-evaluate nil
1948 org-cycle-separator-lines 0 1960 org-cycle-separator-lines 0
@@ -1989,12 +2001,24 @@ browser defined in `browse-url-secondary-browser-function'."
1989 (:unbind "C-j" ; org-return-and-maybe-indent 2001 (:unbind "C-j" ; org-return-and-maybe-indent
1990 "M-j") 2002 "M-j")
1991 2003
1992 (:local-set unfill-fill-function #'org-fill-paragraph) 2004 (:local-set unfill-fill-function #'org-fill-paragraph
2005 wc-count-words-function
2006 (lambda (start end) "Count words stupidly with a limit."
2007 (acdw-org/count-words-stupidly start
2008 end
2009 999)))
1993 2010
1994 (with-eval-after-load 'org-export 2011 (with-eval-after-load 'org-export
1995 (:option (append org-export-filter-final-output-functions) 2012 (:option (append org-export-filter-final-output-functions)
1996 #'org-export-remove-zero-width-spaces)) 2013 #'org-export-remove-zero-width-spaces))
1997 2014
2015 (:local-hook before-save-hook
2016 (defun org/before-save@fix-blank-lines ()
2017 (acdw-org/fix-blank-lines t))
2018 before-save-hook
2019 (defun org/before-save@align-tags ()
2020 (org-align-tags :all)))
2021
1998 (:hook ;; #'variable-pitch-mode 2022 (:hook ;; #'variable-pitch-mode
1999 2023
2000 ;; (defun org-mode@before-save@fill-buffer () 2024 ;; (defun org-mode@before-save@fill-buffer ()
@@ -2006,22 +2030,23 @@ browser defined in `browse-url-secondary-browser-function'."
2006 ;; This is super ugly because I need to add a function to 2030 ;; This is super ugly because I need to add a function to
2007 ;; `before-save-hook', but only in org-mode buffers. So I make a hook 2031 ;; `before-save-hook', but only in org-mode buffers. So I make a hook
2008 ;; to make a hook. I'm sure there's a better way to do this. 2032 ;; to make a hook. I'm sure there's a better way to do this.
2009 (defun org-mode@fix-blank-lines-on-save () 2033 ;; (defun org-mode@fix-blank-lines-on-save ()
2010 (add-hook 'before-save-hook 2034 ;; (add-hook 'before-save-hook
2011 (defun acdw-org/fix-blank-lines-in-buffer () 2035 ;; (defun acdw-org/fix-blank-lines-in-buffer ()
2012 (acdw-org/fix-blank-lines t)) 2036 ;; (acdw-org/fix-blank-lines t))
2013 0 :local)) 2037 ;; 0 :local))
2014 2038
2015 (defun org-mode@wc-stupid () 2039 ;; (defun org-mode@wc-stupid ()
2016 (unless (and wc-mode 2040 ;; (unless (and wc-mode
2017 (> 0 (+ (or wc-orig-words 0) 2041 ;; (> 0 (+ (or wc-orig-words 0)
2018 (or wc-words-delta 0))))) 2042 ;; (or wc-words-delta 0)))))
2019 (setq-local 2043 ;; (setq-local
2020 wc-count-words-function 2044 ;; wc-count-words-function
2021 (lambda (start end) "Count words stupidly with a limit." 2045 ;; (lambda (start end) "Count words stupidly with a limit."
2022 (acdw-org/count-words-stupidly start 2046 ;; (acdw-org/count-words-stupidly start
2023 end 2047 ;; end
2024 999))))) 2048 ;; 999))))
2049 )
2025 2050
2026 (with-eval-after-load 'org 2051 (with-eval-after-load 'org
2027 (org-clock-persistence-insinuate)) 2052 (org-clock-persistence-insinuate))
@@ -2197,6 +2222,7 @@ the default is \"/\"."
2197 acdw-modeline/buffer-name 2222 acdw-modeline/buffer-name
2198 acdw-modeline/vc-branch 2223 acdw-modeline/vc-branch
2199 acdw-modeline/wc 2224 acdw-modeline/wc
2225 acdw-modeline/nyan-cat
2200 acdw-modeline/position 2226 acdw-modeline/position
2201 ) (;; right 2227 ) (;; right
2202 acdw-modeline/track 2228 acdw-modeline/track
@@ -2324,6 +2350,18 @@ the default is \"/\"."
2324 (auto-save-visited-mode -1) 2350 (auto-save-visited-mode -1)
2325 (super-save-mode +1)) 2351 (super-save-mode +1))
2326 2352
2353(setup (:straight-when system-packages
2354 (seq-some #'executable-find
2355 ;; I can't use `system-packages-supported-package-managers'
2356 ;; because, well, the package isn't installed yet. So
2357 ;; ... update this list if any package managers are added.
2358 '("guix" "nix"
2359 "brew" "macports"
2360 "pacman" "emerge"
2361 "zypper" "dnf"
2362 "apt" "aptitude"
2363 "xbps"))))
2364
2327(setup (:straight-when systemd 2365(setup (:straight-when systemd
2328 (executable-find "systemd"))) 2366 (executable-find "systemd")))
2329 2367
@@ -2337,8 +2375,11 @@ the default is \"/\"."
2337 (list 2375 (list
2338 (propertize " " 2376 (propertize " "
2339 'display 2377 'display
2340 '((space :align-to 2378 '((space
2341 ,(unless visual-fill-column-mode 0)))) 2379 :align-to
2380 ,(unless
2381 (bound-and-true-p visual-fill-column-mode)
2382 0))))
2342 (funcall topsy-fn)))))) 2383 (funcall topsy-fn))))))
2343 2384
2344(setup (:straight trashed) 2385(setup (:straight trashed)
@@ -2434,7 +2475,15 @@ If used with a numeric prefix argument N, N backticks will be inserted."
2434 (setq-local indicate-empty-lines nil 2475 (setq-local indicate-empty-lines nil
2435 indicate-buffer-boundaries nil) 2476 indicate-buffer-boundaries nil)
2436 (acdw/setup-fringes)))) 2477 (acdw/setup-fringes))))
2437 (:advise text-scale-adjust :after #'visual-fill-column-adjust)) 2478 (:advise text-scale-adjust :after #'visual-fill-column-adjust)
2479 ;; Fix bindings
2480 (when (bound-and-true-p mouse-wheel-mode)
2481 (with-eval-after-load 'visual-fill-column
2482 (dolist (margin '(right-margin left-margin))
2483 (dolist (event '(wheel-down wheel-up))
2484 (define-key visual-fill-column-mode-map
2485 (vector margin event)
2486 #'mwheel-scroll))))))
2438 2487
2439(setup (:straight visual-regexp) 2488(setup (:straight visual-regexp)
2440 (:global "M-%" #'vr/query-replace)) 2489 (:global "M-%" #'vr/query-replace))