From 4c9d8ea075657b1c35d3b7352043725b59525a82 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 14 Sep 2021 16:56:56 -0500 Subject: ~mehehheheh --- init.el | 69 ++++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 36 insertions(+), 33 deletions(-) (limited to 'init.el') 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!!!" (load (expand-file-name "eshell" user-emacs-directory)))))) (setup eww + (defvar-local eww-readable-p nil + "Whether current buffer is in readable-mode.") (:option eww-search-prefix "https://duckduckgo.com/html?q=" url-privacy-level '(email agent cookies lastloc)) + + (defun eww@is-readable (&rest _) + (setq-local eww-readable-p t)) + (defun eww@is-not-readable (&rest _) + (setq-local eww-readable-p nil)) + + (advice-add 'eww-readable :after #'eww@is-readable) + (advice-add 'eww-render :after #'eww@is-not-readable) + (advice-add 'eww-back-url :after #'eww@is-not-readable) (:hook #'reading-mode)) @@ -945,29 +956,7 @@ AKA, DO NOT USE THIS FUNCTION!!!" (exec-path-from-shell-initialize))) (setup (:straight expand-region) - (:global "C-=" #'er/expand-region - "C-SPC" - (defun acdw/set-mark-or-expand-region (arg) - "Set mark at point and activate, jump to mark, or expand region. -See `set-mark-command' and `expand-region'. - -With no prefix argument, either run `set-mark-command' on first -invocation and `er/expand-region' on each successive invocation. - -With any prefix argument -(e.g., \\[universal-argument] \\[set-mark-command]), act as with -`set-mark-command' (i.e., pop the mark). Don't care about -successive invocations." - (interactive "P") - (cond - ((or arg - (and set-mark-command-repeat-pop - (eq last-command 'pop-to-mark-command))) - (setq this-command 'set-mark-command) - (set-mark-command arg)) - ((eq last-command 'acdw/set-mark-or-expand-region) - (er/expand-region 1)) - (t (set-mark-command arg)))))) + (:global "C-=" #'er/expand-region)) (setup (:straight-if fennel-mode (executable-find "fennel")) @@ -1057,11 +1046,18 @@ specific to most general, they are these: (setup (:straight flyspell-correct) (:option flyspell-correct-interface #'flyspell-correct-completing-read - flyspell-correct--cr-key "`") + flyspell-correct--cr-key ";") + + (defun acdw/flyspell-correct-f7 () + "Run a full spell correction on the current buffer." + (interactive) + (save-mark-and-excursion + (flyspell-correct-move 0 :forward :rapid))) + (:with-feature flyspell - (:hook (defun flyspell@correct () - (:bind "C-;" #'flyspell-correct-wrapper) - (:unbind "C-," "C-." "C-M-i"))))) + (:bind "C-." #'flyspell-correct-wrapper + "" #'acdw/flyspell-correct-f7) + (:unbind "C-," "C-." "C-M-i"))) (setup (:straight-if forge (acdw/system :home)) @@ -1349,9 +1345,11 @@ browser defined in `browse-url-secondary-browser-function'." (setup (:straight markdown-mode) (:file-match (rx ".md" eos) (rx ".markdown" eos)) + (:hook #'variable-pitch-mode) (:with-mode gfm-mode - (:file-match (rx "README.md" eos))) + (:file-match (rx "README.md" eos)) + (:hook #'variable-pitch-mode)) (when (executable-find "markdownfmt") (with-eval-after-load 'apheleia @@ -1491,10 +1489,11 @@ browser defined in `browse-url-secondary-browser-function'." (:option org-adapt-indentation nil org-agenda-files nil ; only until I set this up - org-catch-invisible-edits 'smart + org-catch-invisible-edits 'show-and-error org-clock-clocked-in-display 'mode-line org-clock-string-limit 7 ; gives time and not title org-confirm-babel-evaluate nil + org-cycle-separator-lines 0 org-directory "~/org" org-ellipsis " …" org-export-coding-system 'utf-8-unix @@ -1510,6 +1509,9 @@ browser defined in `browse-url-secondary-browser-function'." org-html-coding-system 'utf-8-unix org-image-actual-width '(300) org-imenu-depth 3 + org-list-demote-modify-bullet '(("-" . "+") + ("+" . "*") + ("*" . "-")) org-outline-path-complete-in-steps nil org-pretty-entities t org-refile-use-outline-path 'file @@ -1614,7 +1616,7 @@ browser defined in `browse-url-secondary-browser-function'." (paredit-mode +1)) (dolist (mode lispy-modes) - (add-hook (intern (concat (symbol-name mode) "-hook")) + (add-hook (intern (format "%s-hook" mode)) #'paredit@setup)) (:also-load eldoc) @@ -1622,7 +1624,7 @@ browser defined in `browse-url-secondary-browser-function'." (setup (:straight paren-face) (dolist (mode lispy-modes) - (add-hook (intern (concat (symbol-name mode) "-hook")) #'paren-face-mode))) + (add-hook (intern (format "%s-hook" mode)) #'paren-face-mode))) (setup (:straight-if (pdf-tools :host github @@ -1652,8 +1654,8 @@ browser defined in `browse-url-secondary-browser-function'." (:global "C-c l t" #'powerthesaurus-lookup-word-dwim)) (setup (:straight prism) - (:hook-into lisp-mode - c-mode)) + (dolist (mode lispy-modes) + (add-hook (intern (format "%s-hook" mode)) #'prism-mode))) (setup prog (:option show-paren-delay 0 @@ -1824,6 +1826,7 @@ browser defined in `browse-url-secondary-browser-function'." simple-modeline-segment-process acdw-modeline/god-mode-indicator acdw-modeline/minions + acdw-modeline/reading-mode acdw-modeline/narrowed acdw-modeline/major-mode))) -- cgit 1.4.1-21-gabe81