diff options
Diffstat (limited to 'init.el')
-rw-r--r-- | init.el | 69 |
1 files changed, 36 insertions, 33 deletions
diff --git a/init.el b/init.el index ec5a825..4e558b8 100644 --- a/init.el +++ b/init.el | |||
@@ -934,8 +934,19 @@ AKA, DO NOT USE THIS FUNCTION!!!" | |||
934 | (load (expand-file-name "eshell" user-emacs-directory)))))) | 934 | (load (expand-file-name "eshell" user-emacs-directory)))))) |
935 | 935 | ||
936 | (setup eww | 936 | (setup eww |
937 | (defvar-local eww-readable-p nil | ||
938 | "Whether current buffer is in readable-mode.") | ||
937 | (:option eww-search-prefix "https://duckduckgo.com/html?q=" | 939 | (:option eww-search-prefix "https://duckduckgo.com/html?q=" |
938 | url-privacy-level '(email agent cookies lastloc)) | 940 | url-privacy-level '(email agent cookies lastloc)) |
941 | |||
942 | (defun eww@is-readable (&rest _) | ||
943 | (setq-local eww-readable-p t)) | ||
944 | (defun eww@is-not-readable (&rest _) | ||
945 | (setq-local eww-readable-p nil)) | ||
946 | |||
947 | (advice-add 'eww-readable :after #'eww@is-readable) | ||
948 | (advice-add 'eww-render :after #'eww@is-not-readable) | ||
949 | (advice-add 'eww-back-url :after #'eww@is-not-readable) | ||
939 | 950 | ||
940 | (:hook #'reading-mode)) | 951 | (:hook #'reading-mode)) |
941 | 952 | ||
@@ -945,29 +956,7 @@ AKA, DO NOT USE THIS FUNCTION!!!" | |||
945 | (exec-path-from-shell-initialize))) | 956 | (exec-path-from-shell-initialize))) |
946 | 957 | ||
947 | (setup (:straight expand-region) | 958 | (setup (:straight expand-region) |
948 | (:global "C-=" #'er/expand-region | 959 | (:global "C-=" #'er/expand-region)) |
949 | "C-SPC" | ||
950 | (defun acdw/set-mark-or-expand-region (arg) | ||
951 | "Set mark at point and activate, jump to mark, or expand region. | ||
952 | See `set-mark-command' and `expand-region'. | ||
953 | |||
954 | With no prefix argument, either run `set-mark-command' on first | ||
955 | invocation and `er/expand-region' on each successive invocation. | ||
956 | |||
957 | With any prefix argument | ||
958 | (e.g., \\[universal-argument] \\[set-mark-command]), act as with | ||
959 | `set-mark-command' (i.e., pop the mark). Don't care about | ||
960 | successive invocations." | ||
961 | (interactive "P") | ||
962 | (cond | ||
963 | ((or arg | ||
964 | (and set-mark-command-repeat-pop | ||
965 | (eq last-command 'pop-to-mark-command))) | ||
966 | (setq this-command 'set-mark-command) | ||
967 | (set-mark-command arg)) | ||
968 | ((eq last-command 'acdw/set-mark-or-expand-region) | ||
969 | (er/expand-region 1)) | ||
970 | (t (set-mark-command arg)))))) | ||
971 | 960 | ||
972 | (setup (:straight-if fennel-mode | 961 | (setup (:straight-if fennel-mode |
973 | (executable-find "fennel")) | 962 | (executable-find "fennel")) |
@@ -1057,11 +1046,18 @@ specific to most general, they are these: | |||
1057 | 1046 | ||
1058 | (setup (:straight flyspell-correct) | 1047 | (setup (:straight flyspell-correct) |
1059 | (:option flyspell-correct-interface #'flyspell-correct-completing-read | 1048 | (:option flyspell-correct-interface #'flyspell-correct-completing-read |
1060 | flyspell-correct--cr-key "`") | 1049 | flyspell-correct--cr-key ";") |
1050 | |||
1051 | (defun acdw/flyspell-correct-f7 () | ||
1052 | "Run a full spell correction on the current buffer." | ||
1053 | (interactive) | ||
1054 | (save-mark-and-excursion | ||
1055 | (flyspell-correct-move 0 :forward :rapid))) | ||
1056 | |||
1061 | (:with-feature flyspell | 1057 | (:with-feature flyspell |
1062 | (:hook (defun flyspell@correct () | 1058 | (:bind "C-." #'flyspell-correct-wrapper |
1063 | (:bind "C-;" #'flyspell-correct-wrapper) | 1059 | "<f7>" #'acdw/flyspell-correct-f7) |
1064 | (:unbind "C-," "C-." "C-M-i"))))) | 1060 | (:unbind "C-," "C-." "C-M-i"))) |
1065 | 1061 | ||
1066 | (setup (:straight-if forge | 1062 | (setup (:straight-if forge |
1067 | (acdw/system :home)) | 1063 | (acdw/system :home)) |
@@ -1349,9 +1345,11 @@ browser defined in `browse-url-secondary-browser-function'." | |||
1349 | (setup (:straight markdown-mode) | 1345 | (setup (:straight markdown-mode) |
1350 | (:file-match (rx ".md" eos) | 1346 | (:file-match (rx ".md" eos) |
1351 | (rx ".markdown" eos)) | 1347 | (rx ".markdown" eos)) |
1348 | (:hook #'variable-pitch-mode) | ||
1352 | 1349 | ||
1353 | (:with-mode gfm-mode | 1350 | (:with-mode gfm-mode |
1354 | (:file-match (rx "README.md" eos))) | 1351 | (:file-match (rx "README.md" eos)) |
1352 | (:hook #'variable-pitch-mode)) | ||
1355 | 1353 | ||
1356 | (when (executable-find "markdownfmt") | 1354 | (when (executable-find "markdownfmt") |
1357 | (with-eval-after-load 'apheleia | 1355 | (with-eval-after-load 'apheleia |
@@ -1491,10 +1489,11 @@ browser defined in `browse-url-secondary-browser-function'." | |||
1491 | (:option | 1489 | (:option |
1492 | org-adapt-indentation nil | 1490 | org-adapt-indentation nil |
1493 | org-agenda-files nil ; only until I set this up | 1491 | org-agenda-files nil ; only until I set this up |
1494 | org-catch-invisible-edits 'smart | 1492 | org-catch-invisible-edits 'show-and-error |
1495 | org-clock-clocked-in-display 'mode-line | 1493 | org-clock-clocked-in-display 'mode-line |
1496 | org-clock-string-limit 7 ; gives time and not title | 1494 | org-clock-string-limit 7 ; gives time and not title |
1497 | org-confirm-babel-evaluate nil | 1495 | org-confirm-babel-evaluate nil |
1496 | org-cycle-separator-lines 0 | ||
1498 | org-directory "~/org" | 1497 | org-directory "~/org" |
1499 | org-ellipsis " …" | 1498 | org-ellipsis " …" |
1500 | org-export-coding-system 'utf-8-unix | 1499 | org-export-coding-system 'utf-8-unix |
@@ -1510,6 +1509,9 @@ browser defined in `browse-url-secondary-browser-function'." | |||
1510 | org-html-coding-system 'utf-8-unix | 1509 | org-html-coding-system 'utf-8-unix |
1511 | org-image-actual-width '(300) | 1510 | org-image-actual-width '(300) |
1512 | org-imenu-depth 3 | 1511 | org-imenu-depth 3 |
1512 | org-list-demote-modify-bullet '(("-" . "+") | ||
1513 | ("+" . "*") | ||
1514 | ("*" . "-")) | ||
1513 | org-outline-path-complete-in-steps nil | 1515 | org-outline-path-complete-in-steps nil |
1514 | org-pretty-entities t | 1516 | org-pretty-entities t |
1515 | org-refile-use-outline-path 'file | 1517 | org-refile-use-outline-path 'file |
@@ -1614,7 +1616,7 @@ browser defined in `browse-url-secondary-browser-function'." | |||
1614 | (paredit-mode +1)) | 1616 | (paredit-mode +1)) |
1615 | 1617 | ||
1616 | (dolist (mode lispy-modes) | 1618 | (dolist (mode lispy-modes) |
1617 | (add-hook (intern (concat (symbol-name mode) "-hook")) | 1619 | (add-hook (intern (format "%s-hook" mode)) |
1618 | #'paredit@setup)) | 1620 | #'paredit@setup)) |
1619 | 1621 | ||
1620 | (:also-load eldoc) | 1622 | (:also-load eldoc) |
@@ -1622,7 +1624,7 @@ browser defined in `browse-url-secondary-browser-function'." | |||
1622 | 1624 | ||
1623 | (setup (:straight paren-face) | 1625 | (setup (:straight paren-face) |
1624 | (dolist (mode lispy-modes) | 1626 | (dolist (mode lispy-modes) |
1625 | (add-hook (intern (concat (symbol-name mode) "-hook")) #'paren-face-mode))) | 1627 | (add-hook (intern (format "%s-hook" mode)) #'paren-face-mode))) |
1626 | 1628 | ||
1627 | (setup (:straight-if (pdf-tools | 1629 | (setup (:straight-if (pdf-tools |
1628 | :host github | 1630 | :host github |
@@ -1652,8 +1654,8 @@ browser defined in `browse-url-secondary-browser-function'." | |||
1652 | (:global "C-c l t" #'powerthesaurus-lookup-word-dwim)) | 1654 | (:global "C-c l t" #'powerthesaurus-lookup-word-dwim)) |
1653 | 1655 | ||
1654 | (setup (:straight prism) | 1656 | (setup (:straight prism) |
1655 | (:hook-into lisp-mode | 1657 | (dolist (mode lispy-modes) |
1656 | c-mode)) | 1658 | (add-hook (intern (format "%s-hook" mode)) #'prism-mode))) |
1657 | 1659 | ||
1658 | (setup prog | 1660 | (setup prog |
1659 | (:option show-paren-delay 0 | 1661 | (:option show-paren-delay 0 |
@@ -1824,6 +1826,7 @@ browser defined in `browse-url-secondary-browser-function'." | |||
1824 | simple-modeline-segment-process | 1826 | simple-modeline-segment-process |
1825 | acdw-modeline/god-mode-indicator | 1827 | acdw-modeline/god-mode-indicator |
1826 | acdw-modeline/minions | 1828 | acdw-modeline/minions |
1829 | acdw-modeline/reading-mode | ||
1827 | acdw-modeline/narrowed | 1830 | acdw-modeline/narrowed |
1828 | acdw-modeline/major-mode))) | 1831 | acdw-modeline/major-mode))) |
1829 | 1832 | ||