summary refs log tree commit diff stats
path: root/init.el
diff options
context:
space:
mode:
authorCase Duckworth2021-10-01 22:23:14 -0500
committerCase Duckworth2021-10-01 22:23:14 -0500
commit4c1475e73977974dcbc7222c95bc762cf627c7a9 (patch)
tree8779877d1958f3be05ae211cf97da6ec48baac47 /init.el
parentChange modeline font (diff)
downloademacs-4c1475e73977974dcbc7222c95bc762cf627c7a9.tar.gz
emacs-4c1475e73977974dcbc7222c95bc762cf627c7a9.zip
Reorganize and shit
- paredit -> smartparens
- re-builder (C-M-5)
- other stuff
- reorder
Diffstat (limited to 'init.el')
-rw-r--r--init.el171
1 files changed, 99 insertions, 72 deletions
diff --git a/init.el b/init.el index 9c3b03b..25aaad6 100644 --- a/init.el +++ b/init.el
@@ -317,19 +317,6 @@
317 "C-c C-k" #'acdw/eval-region-or-buffer 317 "C-c C-k" #'acdw/eval-region-or-buffer
318 "C-c C-z" #'ielm))) 318 "C-c C-z" #'ielm)))
319 319
320(setup pulse
321 (:option pulse-flag nil)
322
323 (defun pulse-line (&rest _)
324 "Pulse the current line."
325 (pulse-momentary-highlight-one-line (point)))
326
327 (dolist (command '(scroll-up-command
328 scroll-down-command
329 recenter-top-bottom other-window
330 switch-to-buffer))
331 (advice-add command :after #'pulse-line)))
332
333(setup emacs 320(setup emacs
334 ;; "Et cetera" settings 321 ;; "Et cetera" settings
335 ;; This should stay as /minimal/ as possible. Anything that can go somewhere 322 ;; This should stay as /minimal/ as possible. Anything that can go somewhere
@@ -365,6 +352,7 @@
365 (global-set-key (kbd "C-c l") lookup-map) 352 (global-set-key (kbd "C-c l") lookup-map)
366 353
367 (:global "M-=" #'count-words 354 (:global "M-=" #'count-words
355 "C-M-;" #'comment-or-uncomment-sexp
368 "C-w" #'kill-region-or-backward-word 356 "C-w" #'kill-region-or-backward-word
369 "C-c d" #'acdw/insert-iso-date 357 "C-c d" #'acdw/insert-iso-date
370 "M-`" nil 358 "M-`" nil
@@ -734,14 +722,40 @@ specific to most general, they are these:
734 show-paren-when-point-in-periphery t 722 show-paren-when-point-in-periphery t
735 smie-indent-basic tab-width) 723 smie-indent-basic tab-width)
736 724
737 (:hook show-paren-mode 725 (:hook #'show-paren-mode
738 electric-pair-local-mode 726 #'electric-pair-local-mode
739 acdw/setup-fringes 727 #'acdw/setup-fringes
728 #'display-fill-column-indicator-mode
740 729
741 (defun prog-mode@auto-fill () 730 (defun prog-mode@auto-fill ()
742 (setq-local comment-auto-fill-only-comments t) 731 (setq-local comment-auto-fill-only-comments t)
743 (turn-on-auto-fill)))) 732 (turn-on-auto-fill))))
744 733
734(setup pulse
735 (:option pulse-flag t
736 pulse-delay 0.5
737 pulse-iterations 1)
738
739 (defun pulse-line (&rest _)
740 "Pulse the current line."
741 (pulse-momentary-highlight-one-line (point)))
742
743 (dolist (command '(scroll-up-command
744 scroll-down-command
745 recenter-top-bottom other-window
746 switch-to-buffer))
747 (advice-add command :after #'pulse-line)))
748
749(setup re-builder
750 (require 'acdw-re)
751 (:global "C-M-5" #'re-builder
752 "C-M-%" #'re-builder)
753 (:with-map reb-mode-map
754 (:bind "C-c C-k" #'reb-quit
755 "RET" #'reb-replace-regexp))
756 (:with-map reb-lisp-mode-map
757 (:bind "RET" #'reb-replace-regexp)))
758
745(setup repeat 759(setup repeat
746 ;; new for Emacs 28! 760 ;; new for Emacs 28!
747 (:only-if (fboundp #'repeat-mode)) 761 (:only-if (fboundp #'repeat-mode))
@@ -1091,11 +1105,13 @@ specific to most general, they are these:
1091 lui-track-behavior 'before-switch-to-buffer 1105 lui-track-behavior 'before-switch-to-buffer
1092 lui-track-indicator 'fringe 1106 lui-track-indicator 'fringe
1093 lui-fill-remove-face-from-newline nil) 1107 lui-fill-remove-face-from-newline nil)
1094 1108
1095 (:hook #'visual-fill-column-mode 1109 (:hook #'visual-fill-column-mode
1096 #'visual-line-mode) 1110 #'visual-line-mode)
1097 1111
1098 (:local-set fringes-outside-margins t 1112 (:local-set visual-fill-column-extra-text-width (cons acdw-irc/left-margin
1113 0)
1114 fringes-outside-margins t
1099 right-margin-width 5 1115 right-margin-width 5
1100 scroll-margin 0 1116 scroll-margin 0
1101 word-wrap t 1117 word-wrap t
@@ -1207,8 +1223,8 @@ specific to most general, they are these:
1207 (crux-reopen-as-root-mode +1)) 1223 (crux-reopen-as-root-mode +1))
1208 1224
1209(setup (:straight-if (define-repeat-map 1225(setup (:straight-if (define-repeat-map
1210 :host nil 1226 :host nil
1211 :repo "https://tildegit.org/acdw/define-repeat-map.el") 1227 :repo "https://tildegit.org/acdw/define-repeat-map.el")
1212 (acdw/system :home)) 1228 (acdw/system :home))
1213 1229
1214 (require 'define-repeat-map ; just for me 1230 (require 'define-repeat-map ; just for me
@@ -1732,7 +1748,7 @@ browser defined in `browse-url-secondary-browser-function'."
1732 modus-themes-bold-constructs t 1748 modus-themes-bold-constructs t
1733 modus-themes-fringes nil 1749 modus-themes-fringes nil
1734 modus-themes-mode-line '(borderless moody) 1750 modus-themes-mode-line '(borderless moody)
1735 modus-themes-region '(bg-only no-extend) 1751 modus-themes-region '(bg-only)
1736 modus-themes-org-blocks 'gray-background 1752 modus-themes-org-blocks 'gray-background
1737 modus-themes-headings '((t . (background))) 1753 modus-themes-headings '((t . (background)))
1738 modus-themes-lang-checkers '(straight-underline) 1754 modus-themes-lang-checkers '(straight-underline)
@@ -1744,27 +1760,27 @@ browser defined in `browse-url-secondary-browser-function'."
1744 (add-hook 'modus-themes-after-load-theme-hook 1760 (add-hook 'modus-themes-after-load-theme-hook
1745 (defun modus-themes@customize-faces () 1761 (defun modus-themes@customize-faces ()
1746 "Customize faces of modus-themes." 1762 "Customize faces of modus-themes."
1747 (dolist (face '(font-lock-builtin-face 1763 ;; (dolist (face '(font-lock-builtin-face
1748 ;; font-lock-comment-delimiter-face 1764 ;; ;; font-lock-comment-delimiter-face
1749 ;; font-lock-coment-face 1765 ;; ;; font-lock-coment-face
1750 font-lock-constant-face 1766 ;; font-lock-constant-face
1751 ;; font-lock-doc-face 1767 ;; ;; font-lock-doc-face
1752 font-lock-function-name-face 1768 ;; font-lock-function-name-face
1753 font-lock-keyword-face 1769 ;; font-lock-keyword-face
1754 font-lock-negation-char-face 1770 ;; font-lock-negation-char-face
1755 font-lock-preprocessor-face 1771 ;; font-lock-preprocessor-face
1756 font-lock-regexp-grouping-backslash 1772 ;; font-lock-regexp-grouping-backslash
1757 font-lock-regexp-goruping-construct 1773 ;; font-lock-regexp-goruping-construct
1758 font-lock-string-face 1774 ;; font-lock-string-face
1759 font-lock-type-face 1775 ;; font-lock-type-face
1760 font-lock-variable-name-face 1776 ;; font-lock-variable-name-face
1761 font-lock-warning-face)) 1777 ;; font-lock-warning-face))
1762 (modus-themes-with-colors 1778 ;; (modus-themes-with-colors
1763 (custom-set-faces 1779 ;; (custom-set-faces
1764 `(,face 1780 ;; `(,face
1765 ((,class :foreground ,fg-main 1781 ;; ((,class :foreground ,fg-main
1766 :weight normal 1782 ;; :weight normal
1767 :slant normal)))))) 1783 ;; :slant normal))))))
1768 ;; Other faces 1784 ;; Other faces
1769 (modus-themes-with-colors 1785 (modus-themes-with-colors
1770 (custom-set-faces 1786 (custom-set-faces
@@ -1801,15 +1817,15 @@ browser defined in `browse-url-secondary-browser-function'."
1801 (:option nov-text-width fill-column) 1817 (:option nov-text-width fill-column)
1802 (:file-match (rx ".epub" eos))) 1818 (:file-match (rx ".epub" eos)))
1803 1819
1804(setup (:straight olivetti) 1820;; (setup (:straight olivetti)
1805 (:option olivetti-body-width (+ fill-column 4) 1821;; (:option olivetti-body-width (+ fill-column 4)
1806 olivetti-minimum-body-width fill-column) 1822;; olivetti-minimum-body-width fill-column)
1807 1823
1808 (:hook (defun olivetti-mode@setup () 1824;; (:hook (defun olivetti-mode@setup ()
1809 (if olivetti-mode 1825;; (if olivetti-mode
1810 (setq-local indicate-empty-lines nil 1826;; (setq-local indicate-empty-lines nil
1811 indicate-buffer-boundaries nil) 1827;; indicate-buffer-boundaries nil)
1812 (acdw/setup-fringes))))) 1828;; (acdw/setup-fringes)))))
1813 1829
1814(setup (:straight (orderless 1830(setup (:straight (orderless
1815 :host github 1831 :host github
@@ -2055,32 +2071,30 @@ the default is \"/\"."
2055(setup (:straight org-sticky-header) 2071(setup (:straight org-sticky-header)
2056 (:hook-into org-mode)) 2072 (:hook-into org-mode))
2057 2073
2058(setup (:straight package-lint)) 2074(setup (:straight package-lint
2059 2075 package-lint-flymake))
2060(setup (:straight package-lint-flymake))
2061 2076
2062(setup (:straight page-break-lines) 2077(setup (:straight page-break-lines)
2063 (global-page-break-lines-mode +1)) 2078 (global-page-break-lines-mode +1))
2064 2079
2065(setup (:straight paredit) 2080;; (setup (:straight paredit)
2066 (:bind "DEL" #'paredit-backward-delete 2081;; (:bind "DEL" #'paredit-backward-delete
2067 "C-M-;" #'comment-or-uncomment-sexp 2082;; "C-<backspace>" #'paredit-backward-kill-word
2068 "C-<backspace>" #'paredit-backward-kill-word 2083;; "M-w" #'paredit-copy-as-kill
2069 "M-w" #'paredit-copy-as-kill 2084;; "RET" #'paredit-newline)
2070 "RET" #'paredit-newline)
2071 2085
2072 (:unbind "M-s" ; paredit-splice-sexp 2086;; (:unbind "M-s" ; paredit-splice-sexp
2073 "C-j" ; paredit-newline (rebound to RET) 2087;; "C-j" ; paredit-newline (rebound to RET)
2074 ) 2088;; )
2075 2089
2076 (:hook-into emacs-lisp-mode 2090;; (:hook-into emacs-lisp-mode
2077 ielm-mode sly-repl-mode 2091;; ielm-mode sly-repl-mode
2078 lisp-mode 2092;; lisp-mode
2079 lisp-interaction-mode 2093;; lisp-interaction-mode
2080 scheme-mode) 2094;; scheme-mode)
2081 2095
2082 (:also-load eldoc) 2096;; (:also-load eldoc)
2083 (eldoc-add-command 'paredit-backward-delete 'paredit-close-round)) 2097;; (eldoc-add-command 'paredit-backward-delete 'paredit-close-round))
2084 2098
2085(setup (:straight paren-face) 2099(setup (:straight paren-face)
2086 (:hook-into emacs-lisp-mode 2100 (:hook-into emacs-lisp-mode
@@ -2206,6 +2220,10 @@ the default is \"/\"."
2206 2220
2207 (:bind "C-c C-c" #'sly-mrepl-return))) 2221 (:bind "C-c C-c" #'sly-mrepl-return)))
2208 2222
2223(setup (:straight smartparens)
2224 (require 'smartparens-config)
2225 (add-hook 'prog-mode #'smartparens-strict-mode))
2226
2209(setup (:straight ssh-config-mode) 2227(setup (:straight ssh-config-mode)
2210 (:file-match (rx "/.ssh/config" eos) 2228 (:file-match (rx "/.ssh/config" eos)
2211 (rx "/ssh" (? "d") "_config" eos)) 2229 (rx "/ssh" (? "d") "_config" eos))
@@ -2232,7 +2250,16 @@ the default is \"/\"."
2232(setup (:straight (topsy 2250(setup (:straight (topsy
2233 :host github 2251 :host github
2234 :repo "alphapapa/topsy.el")) 2252 :repo "alphapapa/topsy.el"))
2235 (:hook-into prog-mode)) 2253 (:hook-into prog-mode)
2254 (:when-loaded
2255 (:option topsy-header-line-format
2256 '(:eval
2257 (list
2258 (propertize " "
2259 'display
2260 '((space :align-to
2261 ,(unless visual-fill-column-mode 0))))
2262 (funcall topsy-fn))))))
2236 2263
2237(setup (:straight trashed) 2264(setup (:straight trashed)
2238 (:option trashed-action-confirmer #'y-or-n-p)) 2265 (:option trashed-action-confirmer #'y-or-n-p))