From 4c1475e73977974dcbc7222c95bc762cf627c7a9 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 1 Oct 2021 22:23:14 -0500 Subject: Reorganize and shit - paredit -> smartparens - re-builder (C-M-5) - other stuff - reorder --- init.el | 171 +++++++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 99 insertions(+), 72 deletions(-) (limited to 'init.el') diff --git a/init.el b/init.el index 9c3b03b..25aaad6 100644 --- a/init.el +++ b/init.el @@ -317,19 +317,6 @@ "C-c C-k" #'acdw/eval-region-or-buffer "C-c C-z" #'ielm))) -(setup pulse - (:option pulse-flag nil) - - (defun pulse-line (&rest _) - "Pulse the current line." - (pulse-momentary-highlight-one-line (point))) - - (dolist (command '(scroll-up-command - scroll-down-command - recenter-top-bottom other-window - switch-to-buffer)) - (advice-add command :after #'pulse-line))) - (setup emacs ;; "Et cetera" settings ;; This should stay as /minimal/ as possible. Anything that can go somewhere @@ -365,6 +352,7 @@ (global-set-key (kbd "C-c l") lookup-map) (:global "M-=" #'count-words + "C-M-;" #'comment-or-uncomment-sexp "C-w" #'kill-region-or-backward-word "C-c d" #'acdw/insert-iso-date "M-`" nil @@ -734,14 +722,40 @@ specific to most general, they are these: show-paren-when-point-in-periphery t smie-indent-basic tab-width) - (:hook show-paren-mode - electric-pair-local-mode - acdw/setup-fringes + (:hook #'show-paren-mode + #'electric-pair-local-mode + #'acdw/setup-fringes + #'display-fill-column-indicator-mode (defun prog-mode@auto-fill () (setq-local comment-auto-fill-only-comments t) (turn-on-auto-fill)))) +(setup pulse + (:option pulse-flag t + pulse-delay 0.5 + pulse-iterations 1) + + (defun pulse-line (&rest _) + "Pulse the current line." + (pulse-momentary-highlight-one-line (point))) + + (dolist (command '(scroll-up-command + scroll-down-command + recenter-top-bottom other-window + switch-to-buffer)) + (advice-add command :after #'pulse-line))) + +(setup re-builder + (require 'acdw-re) + (:global "C-M-5" #'re-builder + "C-M-%" #'re-builder) + (:with-map reb-mode-map + (:bind "C-c C-k" #'reb-quit + "RET" #'reb-replace-regexp)) + (:with-map reb-lisp-mode-map + (:bind "RET" #'reb-replace-regexp))) + (setup repeat ;; new for Emacs 28! (:only-if (fboundp #'repeat-mode)) @@ -1091,11 +1105,13 @@ specific to most general, they are these: lui-track-behavior 'before-switch-to-buffer lui-track-indicator 'fringe lui-fill-remove-face-from-newline nil) - + (:hook #'visual-fill-column-mode #'visual-line-mode) - (:local-set fringes-outside-margins t + (:local-set visual-fill-column-extra-text-width (cons acdw-irc/left-margin + 0) + fringes-outside-margins t right-margin-width 5 scroll-margin 0 word-wrap t @@ -1207,8 +1223,8 @@ specific to most general, they are these: (crux-reopen-as-root-mode +1)) (setup (:straight-if (define-repeat-map - :host nil - :repo "https://tildegit.org/acdw/define-repeat-map.el") + :host nil + :repo "https://tildegit.org/acdw/define-repeat-map.el") (acdw/system :home)) (require 'define-repeat-map ; just for me @@ -1732,7 +1748,7 @@ browser defined in `browse-url-secondary-browser-function'." modus-themes-bold-constructs t modus-themes-fringes nil modus-themes-mode-line '(borderless moody) - modus-themes-region '(bg-only no-extend) + modus-themes-region '(bg-only) modus-themes-org-blocks 'gray-background modus-themes-headings '((t . (background))) modus-themes-lang-checkers '(straight-underline) @@ -1744,27 +1760,27 @@ browser defined in `browse-url-secondary-browser-function'." (add-hook 'modus-themes-after-load-theme-hook (defun modus-themes@customize-faces () "Customize faces of modus-themes." - (dolist (face '(font-lock-builtin-face - ;; font-lock-comment-delimiter-face - ;; font-lock-coment-face - font-lock-constant-face - ;; font-lock-doc-face - font-lock-function-name-face - font-lock-keyword-face - font-lock-negation-char-face - font-lock-preprocessor-face - font-lock-regexp-grouping-backslash - font-lock-regexp-goruping-construct - font-lock-string-face - font-lock-type-face - font-lock-variable-name-face - font-lock-warning-face)) - (modus-themes-with-colors - (custom-set-faces - `(,face - ((,class :foreground ,fg-main - :weight normal - :slant normal)))))) + ;; (dolist (face '(font-lock-builtin-face + ;; ;; font-lock-comment-delimiter-face + ;; ;; font-lock-coment-face + ;; font-lock-constant-face + ;; ;; font-lock-doc-face + ;; font-lock-function-name-face + ;; font-lock-keyword-face + ;; font-lock-negation-char-face + ;; font-lock-preprocessor-face + ;; font-lock-regexp-grouping-backslash + ;; font-lock-regexp-goruping-construct + ;; font-lock-string-face + ;; font-lock-type-face + ;; font-lock-variable-name-face + ;; font-lock-warning-face)) + ;; (modus-themes-with-colors + ;; (custom-set-faces + ;; `(,face + ;; ((,class :foreground ,fg-main + ;; :weight normal + ;; :slant normal)))))) ;; Other faces (modus-themes-with-colors (custom-set-faces @@ -1801,15 +1817,15 @@ browser defined in `browse-url-secondary-browser-function'." (:option nov-text-width fill-column) (:file-match (rx ".epub" eos))) -(setup (:straight olivetti) - (:option olivetti-body-width (+ fill-column 4) - olivetti-minimum-body-width fill-column) - - (:hook (defun olivetti-mode@setup () - (if olivetti-mode - (setq-local indicate-empty-lines nil - indicate-buffer-boundaries nil) - (acdw/setup-fringes))))) +;; (setup (:straight olivetti) +;; (:option olivetti-body-width (+ fill-column 4) +;; olivetti-minimum-body-width fill-column) + +;; (:hook (defun olivetti-mode@setup () +;; (if olivetti-mode +;; (setq-local indicate-empty-lines nil +;; indicate-buffer-boundaries nil) +;; (acdw/setup-fringes))))) (setup (:straight (orderless :host github @@ -2055,32 +2071,30 @@ the default is \"/\"." (setup (:straight org-sticky-header) (:hook-into org-mode)) -(setup (:straight package-lint)) - -(setup (:straight package-lint-flymake)) +(setup (:straight package-lint + package-lint-flymake)) (setup (:straight page-break-lines) (global-page-break-lines-mode +1)) -(setup (:straight paredit) - (:bind "DEL" #'paredit-backward-delete - "C-M-;" #'comment-or-uncomment-sexp - "C-" #'paredit-backward-kill-word - "M-w" #'paredit-copy-as-kill - "RET" #'paredit-newline) +;; (setup (:straight paredit) +;; (:bind "DEL" #'paredit-backward-delete +;; "C-" #'paredit-backward-kill-word +;; "M-w" #'paredit-copy-as-kill +;; "RET" #'paredit-newline) - (:unbind "M-s" ; paredit-splice-sexp - "C-j" ; paredit-newline (rebound to RET) - ) +;; (:unbind "M-s" ; paredit-splice-sexp +;; "C-j" ; paredit-newline (rebound to RET) +;; ) - (:hook-into emacs-lisp-mode - ielm-mode sly-repl-mode - lisp-mode - lisp-interaction-mode - scheme-mode) - - (:also-load eldoc) - (eldoc-add-command 'paredit-backward-delete 'paredit-close-round)) +;; (:hook-into emacs-lisp-mode +;; ielm-mode sly-repl-mode +;; lisp-mode +;; lisp-interaction-mode +;; scheme-mode) + +;; (:also-load eldoc) +;; (eldoc-add-command 'paredit-backward-delete 'paredit-close-round)) (setup (:straight paren-face) (:hook-into emacs-lisp-mode @@ -2206,6 +2220,10 @@ the default is \"/\"." (:bind "C-c C-c" #'sly-mrepl-return))) +(setup (:straight smartparens) + (require 'smartparens-config) + (add-hook 'prog-mode #'smartparens-strict-mode)) + (setup (:straight ssh-config-mode) (:file-match (rx "/.ssh/config" eos) (rx "/ssh" (? "d") "_config" eos)) @@ -2232,7 +2250,16 @@ the default is \"/\"." (setup (:straight (topsy :host github :repo "alphapapa/topsy.el")) - (:hook-into prog-mode)) + (:hook-into prog-mode) + (:when-loaded + (:option topsy-header-line-format + '(:eval + (list + (propertize " " + 'display + '((space :align-to + ,(unless visual-fill-column-mode 0)))) + (funcall topsy-fn)))))) (setup (:straight trashed) (:option trashed-action-confirmer #'y-or-n-p)) -- cgit 1.4.1-21-gabe81