about summary refs log tree commit diff stats
path: root/init.el
diff options
context:
space:
mode:
Diffstat (limited to 'init.el')
-rw-r--r--init.el62
1 files changed, 42 insertions, 20 deletions
diff --git a/init.el b/init.el index 19513ea..b32dfce 100644 --- a/init.el +++ b/init.el
@@ -115,6 +115,7 @@
115 (:global "C-c C-r" #'reading-mode)) 115 (:global "C-c C-r" #'reading-mode))
116 116
117(setup (:require user-save) 117(setup (:require user-save)
118 (add-hook 'user-save-hook #'+clean-empty-lines)
118 (user-save-mode +1)) 119 (user-save-mode +1))
119 120
120(setup +key 121(setup +key
@@ -176,9 +177,9 @@
176 browse-url-secondary-browser-function) 177 browse-url-secondary-browser-function)
177 args))) 178 args)))
178 (cons (+browse-url-secondary-browser-regexps-combine) ; non-text websites 179 (cons (+browse-url-secondary-browser-regexps-combine) ; non-text websites
179 browse-url-secondary-browser-function) 180 browse-url-secondary-browser-function)
180 (cons "." ; everything else 181 (cons "." ; everything else
181 +browse-url-browser-function))) 182 +browse-url-browser-function)))
182 ;; Transform URLs before passing to `browse-url' 183 ;; Transform URLs before passing to `browse-url'
183 (:option +browse-url-transformations `((,(rx "//" (or "youtube.com" 184 (:option +browse-url-transformations `((,(rx "//" (or "youtube.com"
184 "youtu.be")) 185 "youtu.be"))
@@ -463,9 +464,14 @@
463 "<S-return>" #'+org-table-copy-down 464 "<S-return>" #'+org-table-copy-down
464 "C-c C-l" #'+org-insert-link-dwim 465 "C-c C-l" #'+org-insert-link-dwim
465 "C-c C-n" #'+org-next-heading-widen 466 "C-c C-n" #'+org-next-heading-widen
466 "C-c C-p" #'+org-previous-heading-widen) 467 "C-c C-p" #'+org-previous-heading-widen
468 "C-c C-o" #'+org-open-at-point-dwim)
467 (:local-hook user-save-hook #'+org-before-save@prettify-buffer) 469 (:local-hook user-save-hook #'+org-before-save@prettify-buffer)
468 (advice-add #'org-delete-backward-char :override #'+org-delete-backward-char) 470 (advice-add #'org-delete-backward-char :override #'+org-delete-backward-char)
471 ;; (define-advice org-open-at-point (:around (fn &rest r) open-external)
472 ;; "Open links from org externally."
473 ;; (let ((browse-url-browser-function browse-url-secondary-browser-function))
474 ;; (apply fn r)))
469 (with-eval-after-load 'org 475 (with-eval-after-load 'org
470 (org-clock-persistence-insinuate) 476 (org-clock-persistence-insinuate)
471 (org-link-set-parameters "tel" :follow #'+org-tel-open)) 477 (org-link-set-parameters "tel" :follow #'+org-tel-open))
@@ -504,15 +510,18 @@
504 (+org-capture-templates-setf "tt" 510 (+org-capture-templates-setf "tt"
505 `("Today!" entry (file "todo.org") 511 `("Today!" entry (file "todo.org")
506 ,(concat "* TODO %^{Title}\n" 512 ,(concat "* TODO %^{Title}\n"
507 "DEADLINE: %t\n" 513 "DEADLINE: %t\n"
508 "\n%?"))) 514 "\n%?")))
509 (+org-capture-templates-setf "ts" 515 (+org-capture-templates-setf "ts"
510 `("Someday..." entry (file "todo.org") 516 `("Someday..." entry (file "todo.org")
511 ,(concat "* TODO %^{Title}\n" 517 ,(concat "* TODO %^{Title}\n"
512 ":PROPERTIES:\n" 518 ":PROPERTIES:\n"
513 ":CREATED: [%<%F %T>]\n" 519 ":CREATED: [%<%F %T>]\n"
514 ":END:\n" 520 ":END:\n"
515 "\n%?"))) 521 "\n%?")))
522 (+org-capture-templates-setf "l"
523 `("Link" entry (file "links.org")
524 "* %(+org-insert-link-dwim) %^g\n\n"))
516 (+org-capture-sort)) 525 (+org-capture-sort))
517 526
518(setup org-contacts 527(setup org-contacts
@@ -533,6 +542,10 @@
533 ";; ABANDON ALL HOPE YE WHO ENTER HERE\n\n") 542 ";; ABANDON ALL HOPE YE WHO ENTER HERE\n\n")
534 (add-hook 'kill-buffer-query-functions #'+scratch-immortal)) 543 (add-hook 'kill-buffer-query-functions #'+scratch-immortal))
535 544
545(setup shr
546 (:option shr-width (- fill-column 5) ; pad out for wide letters
547 shr-use-fonts t))
548
536(setup text 549(setup text
537 (:hook #'turn-on-auto-fill)) 550 (:hook #'turn-on-auto-fill))
538 551
@@ -544,7 +557,8 @@
544(setup (:straight ace-window) 557(setup (:straight ace-window)
545 (:require +ace-window) 558 (:require +ace-window)
546 (:option aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l) 559 (:option aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)
547 aw-display-mode-overlay nil) 560 aw-display-mode-overlay nil
561 aw-scope 'frame)
548 (:+key "M-o" #'+ace-window-or-switch-buffer) 562 (:+key "M-o" #'+ace-window-or-switch-buffer)
549 (:face aw-mode-line-face ((t (:foreground "red")))) 563 (:face aw-mode-line-face ((t (:foreground "red"))))
550 (+ace-window-display-mode +1)) 564 (+ace-window-display-mode +1))
@@ -914,13 +928,19 @@ See also `crux-reopen-as-root-mode'."
914 (:bind "SPC" #'+elfeed-scroll-up-command 928 (:bind "SPC" #'+elfeed-scroll-up-command
915 "S-SPC" #'+elfeed-scroll-down-command) 929 "S-SPC" #'+elfeed-scroll-down-command)
916 (:hook #'reading-mode) 930 (:hook #'reading-mode)
917 (define-advice elfeed-show-entry (:after (&rest _)) 931 ;; (define-advice elfeed-show-entry (:after (&rest _))
918 "Re-flow the entry a short time after showing it." 932 ;; "Re-flow the entry a short time after showing it."
919 (run-at-time 0.1 nil #'elfeed-show-refresh)))) 933 ;; (run-at-time 0.1 nil #'elfeed-show-refresh))
934 ))
920 935
921(setup (:straight elfeed-org) 936(setup (:straight elfeed-org)
937 (:also-load +org-capture)
922 (:option rmh-elfeed-org-files (list (elfeed/ "elfeed.org" t))) 938 (:option rmh-elfeed-org-files (list (elfeed/ "elfeed.org" t)))
923 (elfeed-org)) 939 (elfeed-org)
940 (+org-capture-templates-setf "f"
941 `("Feed" entry
942 (file+olp ,(car rmh-elfeed-org-files) "Feeds")
943 "* %? %^g")))
924 944
925(setup (:straight elpher)) 945(setup (:straight elpher))
926 946
@@ -990,7 +1010,7 @@ See also `crux-reopen-as-root-mode'."
990 (:+key "M-q" #'filldent-dwim)) 1010 (:+key "M-q" #'filldent-dwim))
991 1011
992(setup (:straight flyspell-correct) 1012(setup (:straight flyspell-correct)
993 (:+also-load +flyspell-correct ) 1013 (:also-load +flyspell-correct)
994 (:option flyspell-correct--cr-key ";") 1014 (:option flyspell-correct--cr-key ";")
995 (:bind-into flyspell 1015 (:bind-into flyspell
996 "C-;" #'flyspell-correct-wrapper 1016 "C-;" #'flyspell-correct-wrapper
@@ -1041,11 +1061,12 @@ See also `crux-reopen-as-root-mode'."
1041 1061
1042(setup (:straight god-mode) 1062(setup (:straight god-mode)
1043 (setq god-mode-enable-function-key-translation nil) 1063 (setq god-mode-enable-function-key-translation nil)
1044 (:also-load +god-mode) 1064 (:require god-mode
1045 (:+key "C-M-g" #'god-local-mode) 1065 +god-mode)
1066 (:+key "C-M-g" #'god-mode-all)
1046 (:with-mode god-local-mode 1067 (:with-mode god-local-mode
1047 (:bind "i" #'+god-mode-insert 1068 (:bind "i" #'+god-mode-insert
1048 "a" #'+god-mode-append))) 1069 "a" nil)))
1049 1070
1050(setup (:straight helpful) 1071(setup (:straight helpful)
1051 (run-with-idle-timer 0.5 nil 1072 (run-with-idle-timer 0.5 nil
@@ -1260,6 +1281,7 @@ See also `crux-reopen-as-root-mode'."
1260(setup (:straight (sophomore 1281(setup (:straight (sophomore
1261 :host github 1282 :host github
1262 :repo "duckwork/sophomore.el")) 1283 :repo "duckwork/sophomore.el"))
1284 (sophomore-enable #'narrow-to-region)
1263 (sophomore-disable #'view-hello-file) 1285 (sophomore-disable #'view-hello-file)
1264 (sophomore-mode +1)) 1286 (sophomore-mode +1))
1265 1287
@@ -1288,8 +1310,8 @@ See also `crux-reopen-as-root-mode'."
1288 (:bind "t" #'titlecase-dwim))) 1310 (:bind "t" #'titlecase-dwim)))
1289 1311
1290(setup (:straight topsy) 1312(setup (:straight topsy)
1291 (:hook-into prog-mode 1313 (:hook-into ;;prog-mode
1292 circe-chat-mode) 1314 circe-chat-mode)
1293 (:when-loaded 1315 (:when-loaded
1294 (:option 1316 (:option
1295 topsy-header-line-format 1317 topsy-header-line-format