summary refs log tree commit diff stats
path: root/init.el
diff options
context:
space:
mode:
authorCase Duckworth2021-09-10 18:41:44 -0500
committerCase Duckworth2021-09-10 18:41:44 -0500
commit0a3b9b49f0192f544a8701e09c69a5c8b34f2efd (patch)
treec92359802b92e82942e64962ef8d6532e944a434 /init.el
parentRequire kaomoji (diff)
parentAdd 💩 (diff)
downloademacs-0a3b9b49f0192f544a8701e09c69a5c8b34f2efd.tar.gz
emacs-0a3b9b49f0192f544a8701e09c69a5c8b34f2efd.zip
Merge branch 'main' of https://tildegit.org/acdw/emacs
Diffstat (limited to 'init.el')
-rw-r--r--init.el64
1 files changed, 48 insertions, 16 deletions
diff --git a/init.el b/init.el index d184baa..9fbc245 100644 --- a/init.el +++ b/init.el
@@ -140,10 +140,23 @@ AKA, DO NOT USE THIS FUNCTION!!!"
140 "png") 140 "png")
141 eos)) 141 eos))
142 (lambda (&rest args) 142 (lambda (&rest args)
143 (apply (if (executable-find "feh") 143 (apply
144 #'browse-url-feh 144 (cond ((executable-find "feh") #'browse-url-feh)
145 #'eww-browse-url) 145 ((executable-find "mpv")
146 args))) 146 (defun browse-image-url-mpv (url &rest _args)
147 "View an image URL in mpv."
148 (let ((url (browse-url-encode-url url))
149 (process-environment
150 (browse-url-process-environment)))
151 (message "Viewing %s in mpv..." url)
152 (apply #'start-process
153 (concat "mpv " url) nil
154 "mpv"
155 (append browse-url-mpv-arguments
156 (list "--image-display-duration=inf"
157 url))))))
158 (t #'eww-browse-url))
159 args)))
147 (cons (rx (or "youtube.com" ; videos 160 (cons (rx (or "youtube.com" ; videos
148 "youtu.be" 161 "youtu.be"
149 (seq "." (or "mp4" 162 (seq "." (or "mp4"
@@ -219,7 +232,9 @@ AKA, DO NOT USE THIS FUNCTION!!!"
219 :channels ("#basement") 232 :channels ("#basement")
220 :sasl-username ,circe-default-nick 233 :sasl-username ,circe-default-nick
221 :sasl-password ,(acdw/make-password-fetcher 234 :sasl-password ,(acdw/make-password-fetcher
222 :host "m455.casa"))) 235 :host "m455.casa"))
236 ;; TODO: irc.chat.twitch.tv
237 )
223 circe-reduce-lurker-spam t 238 circe-reduce-lurker-spam t
224 circe-server-auto-join-default-type :after-auth) 239 circe-server-auto-join-default-type :after-auth)
225 240
@@ -247,6 +262,12 @@ AKA, DO NOT USE THIS FUNCTION!!!"
247 (with-current-buffer buf 262 (with-current-buffer buf
248 (kill-buffer)))))) 263 (kill-buffer))))))
249 264
265 (defun circe-command-SHORTEN (url)
266 "Shorten URL using `0x0-shorten-uri'."
267 (interactive "sURL to shorten: ")
268 (let ((short-url (0x0-shorten-uri (0x0--choose-server) url)))
269 (circe-command-SAY short-url)))
270
250 (:with-mode circe-chat-mode 271 (:with-mode circe-chat-mode
251 (:hook #'acdw/stop-paren-annoyances 272 (:hook #'acdw/stop-paren-annoyances
252 #'enable-circe-color-nicks 273 #'enable-circe-color-nicks
@@ -440,8 +461,8 @@ AKA, DO NOT USE THIS FUNCTION!!!"
440 (:hook visual-line-mode)) 461 (:hook visual-line-mode))
441 462
442(setup (:straight-if (define-repeat-map 463(setup (:straight-if (define-repeat-map
443 :host nil 464 :host nil
444 :repo "https://tildegit.org/acdw/define-repeat-map.el") 465 :repo "https://tildegit.org/acdw/define-repeat-map.el")
445 (acdw/system :home)) 466 (acdw/system :home))
446 467
447 (defun acdw/other-window-or-switch-buffer-backward () 468 (defun acdw/other-window-or-switch-buffer-backward ()
@@ -728,7 +749,9 @@ AKA, DO NOT USE THIS FUNCTION!!!"
728 "M-`" nil 749 "M-`" nil
729 "C-x o" #'acdw/other-window-or-switch-buffer 750 "C-x o" #'acdw/other-window-or-switch-buffer
730 "C-x O" #'acdw/other-window-or-switch-buffer-backward 751 "C-x O" #'acdw/other-window-or-switch-buffer-backward
731 "C-c _" #'add-file-local-variable) 752 "C-c _" #'add-file-local-variable
753 "C-x C-c" #'delete-frame ; I keep fat-fingering and exiting
754 )
732 755
733 (:with-map toggle-map 756 (:with-map toggle-map
734 (:bind "c" #'column-number-mode 757 (:bind "c" #'column-number-mode
@@ -740,7 +763,13 @@ AKA, DO NOT USE THIS FUNCTION!!!"
740 (:bind "c" #'capitalize-dwim 763 (:bind "c" #'capitalize-dwim
741 "t" #'titlecase-dwim 764 "t" #'titlecase-dwim
742 "u" #'upcase-dwim 765 "u" #'upcase-dwim
743 "l" #'downcase-dwim)) 766 "l" #'downcase-dwim
767 "s" (defun studlify-dwim (count)
768 "Studlify region if active, or COUNT words if not."
769 (interactive "*p")
770 (if (region-active-p)
771 (studlify-region (region-beginning) (region-end))
772 (studlify-word count)))))
744 773
745 (add-hook 'after-make-frame-functions 774 (add-hook 'after-make-frame-functions
746 (defun after-make-frame@maximize (frame) 775 (defun after-make-frame@maximize (frame)
@@ -989,10 +1018,10 @@ specific to most general, they are these:
989 "M-p" #'flymake-goto-prev-error)) 1018 "M-p" #'flymake-goto-prev-error))
990 1019
991(setup flyspell 1020(setup flyspell
992 (add-hook 'text-mode-hook #'flyspell-mode)) 1021 (:hook-into text-mode))
993 1022
994(setup (:straight flyspell-correct) 1023(setup (:straight flyspell-correct)
995 (:with-mode flyspell-mode 1024 (:with-feature flyspell
996 (:hook (defun flyspell@correct () 1025 (:hook (defun flyspell@correct ()
997 (:bind "C-;" #'flyspell-correct-wrapper) 1026 (:bind "C-;" #'flyspell-correct-wrapper)
998 (:unbind "C-," "C-." "C-M-i"))))) 1027 (:unbind "C-," "C-." "C-M-i")))))
@@ -1184,11 +1213,11 @@ specific to most general, they are these:
1184 :repo "https://tildegit.org/acdw/kaomoji-insert")) 1213 :repo "https://tildegit.org/acdw/kaomoji-insert"))
1185 (require 'kaomoji-insert) 1214 (require 'kaomoji-insert)
1186 (dolist (km '(("(Ծ‸ Ծ)" "suspicious") 1215 (dolist (km '(("(Ծ‸ Ծ)" "suspicious")
1187 ("(¬‿¬)═ɜ ɛ═(⌐‿⌐ )" "pound it" "fist bump") 1216 ("(¬‿¬)═ɜ ɛ═(⌐‿⌐ )" "pound it" "fist bump")
1188 ("▬▬▬▬▬▬▬▋ Ò╭╮Ó" "hammer") 1217 ("▬▬▬▬▬▬▬▋ Ò╭╮Ó" "hammer")
1189 ("👁👄👁" "lewk") 1218 ("👁👄👁" "lewk")
1190 ("( ͡~ ͜ʖ ͡°)" "wink") 1219 ("( ͡~ ͜ʖ ͡°)" "wink")
1191 ("⊙﹏⊙" "uhhh" "unsure"))) 1220 ("⊙﹏⊙" "uhhh" "unsure")))
1192 (add-to-list 'kaomoji-insert-alist km)) 1221 (add-to-list 'kaomoji-insert-alist km))
1193 (:global "C-x 8 k" #'kaomoji-insert)) 1222 (:global "C-x 8 k" #'kaomoji-insert))
1194 1223
@@ -1340,6 +1369,9 @@ browser defined in `browse-url-secondary-browser-function'."
1340 (acdw/sunrise-sunset #'modus-themes-load-operandi 1369 (acdw/sunrise-sunset #'modus-themes-load-operandi
1341 #'modus-themes-load-vivendi)) 1370 #'modus-themes-load-vivendi))
1342 1371
1372(setup mouse-avoidance
1373 (mouse-avoidance-mode 'exile))
1374
1343(setup (:straight mwim) 1375(setup (:straight mwim)
1344 (:global "C-a" #'mwim-beginning 1376 (:global "C-a" #'mwim-beginning
1345 "C-e" #'mwim-end)) 1377 "C-e" #'mwim-end))