From 9360a54e6208c87911530ea8005b626680fa2e88 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 7 Jan 2022 17:30:46 -0600 Subject: Gah, so many changes --- init.el | 62 ++++++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 42 insertions(+), 20 deletions(-) (limited to 'init.el') diff --git a/init.el b/init.el index 19513ea..b32dfce 100644 --- a/init.el +++ b/init.el @@ -115,6 +115,7 @@ (:global "C-c C-r" #'reading-mode)) (setup (:require user-save) + (add-hook 'user-save-hook #'+clean-empty-lines) (user-save-mode +1)) (setup +key @@ -176,9 +177,9 @@ browse-url-secondary-browser-function) args))) (cons (+browse-url-secondary-browser-regexps-combine) ; non-text websites - browse-url-secondary-browser-function) + browse-url-secondary-browser-function) (cons "." ; everything else - +browse-url-browser-function))) + +browse-url-browser-function))) ;; Transform URLs before passing to `browse-url' (:option +browse-url-transformations `((,(rx "//" (or "youtube.com" "youtu.be")) @@ -463,9 +464,14 @@ "" #'+org-table-copy-down "C-c C-l" #'+org-insert-link-dwim "C-c C-n" #'+org-next-heading-widen - "C-c C-p" #'+org-previous-heading-widen) + "C-c C-p" #'+org-previous-heading-widen + "C-c C-o" #'+org-open-at-point-dwim) (:local-hook user-save-hook #'+org-before-save@prettify-buffer) (advice-add #'org-delete-backward-char :override #'+org-delete-backward-char) + ;; (define-advice org-open-at-point (:around (fn &rest r) open-external) + ;; "Open links from org externally." + ;; (let ((browse-url-browser-function browse-url-secondary-browser-function)) + ;; (apply fn r))) (with-eval-after-load 'org (org-clock-persistence-insinuate) (org-link-set-parameters "tel" :follow #'+org-tel-open)) @@ -504,15 +510,18 @@ (+org-capture-templates-setf "tt" `("Today!" entry (file "todo.org") ,(concat "* TODO %^{Title}\n" - "DEADLINE: %t\n" - "\n%?"))) + "DEADLINE: %t\n" + "\n%?"))) (+org-capture-templates-setf "ts" `("Someday..." entry (file "todo.org") ,(concat "* TODO %^{Title}\n" - ":PROPERTIES:\n" - ":CREATED: [%<%F %T>]\n" - ":END:\n" - "\n%?"))) + ":PROPERTIES:\n" + ":CREATED: [%<%F %T>]\n" + ":END:\n" + "\n%?"))) + (+org-capture-templates-setf "l" + `("Link" entry (file "links.org") + "* %(+org-insert-link-dwim) %^g\n\n")) (+org-capture-sort)) (setup org-contacts @@ -533,6 +542,10 @@ ";; ABANDON ALL HOPE YE WHO ENTER HERE\n\n") (add-hook 'kill-buffer-query-functions #'+scratch-immortal)) +(setup shr + (:option shr-width (- fill-column 5) ; pad out for wide letters + shr-use-fonts t)) + (setup text (:hook #'turn-on-auto-fill)) @@ -544,7 +557,8 @@ (setup (:straight ace-window) (:require +ace-window) (:option aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l) - aw-display-mode-overlay nil) + aw-display-mode-overlay nil + aw-scope 'frame) (:+key "M-o" #'+ace-window-or-switch-buffer) (:face aw-mode-line-face ((t (:foreground "red")))) (+ace-window-display-mode +1)) @@ -914,13 +928,19 @@ See also `crux-reopen-as-root-mode'." (:bind "SPC" #'+elfeed-scroll-up-command "S-SPC" #'+elfeed-scroll-down-command) (:hook #'reading-mode) - (define-advice elfeed-show-entry (:after (&rest _)) - "Re-flow the entry a short time after showing it." - (run-at-time 0.1 nil #'elfeed-show-refresh)))) + ;; (define-advice elfeed-show-entry (:after (&rest _)) + ;; "Re-flow the entry a short time after showing it." + ;; (run-at-time 0.1 nil #'elfeed-show-refresh)) + )) (setup (:straight elfeed-org) + (:also-load +org-capture) (:option rmh-elfeed-org-files (list (elfeed/ "elfeed.org" t))) - (elfeed-org)) + (elfeed-org) + (+org-capture-templates-setf "f" + `("Feed" entry + (file+olp ,(car rmh-elfeed-org-files) "Feeds") + "* %? %^g"))) (setup (:straight elpher)) @@ -990,7 +1010,7 @@ See also `crux-reopen-as-root-mode'." (:+key "M-q" #'filldent-dwim)) (setup (:straight flyspell-correct) - (:+also-load +flyspell-correct ) + (:also-load +flyspell-correct) (:option flyspell-correct--cr-key ";") (:bind-into flyspell "C-;" #'flyspell-correct-wrapper @@ -1041,11 +1061,12 @@ See also `crux-reopen-as-root-mode'." (setup (:straight god-mode) (setq god-mode-enable-function-key-translation nil) - (:also-load +god-mode) - (:+key "C-M-g" #'god-local-mode) + (:require god-mode + +god-mode) + (:+key "C-M-g" #'god-mode-all) (:with-mode god-local-mode (:bind "i" #'+god-mode-insert - "a" #'+god-mode-append))) + "a" nil))) (setup (:straight helpful) (run-with-idle-timer 0.5 nil @@ -1260,6 +1281,7 @@ See also `crux-reopen-as-root-mode'." (setup (:straight (sophomore :host github :repo "duckwork/sophomore.el")) + (sophomore-enable #'narrow-to-region) (sophomore-disable #'view-hello-file) (sophomore-mode +1)) @@ -1288,8 +1310,8 @@ See also `crux-reopen-as-root-mode'." (:bind "t" #'titlecase-dwim))) (setup (:straight topsy) - (:hook-into prog-mode - circe-chat-mode) + (:hook-into ;;prog-mode + circe-chat-mode) (:when-loaded (:option topsy-header-line-format -- cgit 1.4.1-21-gabe81