From 9e46efac61fc4246b810c8b19127248ed7b3080e Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 5 Jan 2022 17:12:32 -0600 Subject: Lots of changes, maybe breaking something I have to do a big debugging tonight. Keybinds aren't getting picked up, idk what's going on. --- init.el | 78 +++++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 40 insertions(+), 38 deletions(-) (limited to 'init.el') diff --git a/init.el b/init.el index 51bcf31..526c867 100644 --- a/init.el +++ b/init.el @@ -15,17 +15,13 @@ ;; - Make good choices. ;;; Code: - -(dolist (feature `((early-init . ,(locate-user-emacs-file "early-init")) - acdw - private)) - (require (or (car-safe feature) feature) (cdr-safe feature) :noerror)) +(let ((early-features `((early-init . ,(locate-user-emacs-file "early-init")) + acdw private +key))) + (dolist (feature early-features) + (require (or (car-safe feature) feature) (cdr-safe feature) :noerror))) (setup (:require +casing) - (:+key "M-c" +casing-map) - ;; Unbind default casing bindings - (:global "M-u" nil "M-c" nil "M-l" nil - "C-x C-u" nil "C-x C-l" nil)) + (+casing-mode +1)) (setup (:require +emacs) ;; +emacs.el contains super-basic defaults that are basically necessary for @@ -37,11 +33,8 @@ (:global "C-x C-k" #'kill-current-buffer "C-x 4 n" #'clone-buffer "C-c v" #'visible-mode - "C-M-;" #'+lisp-comment-or-uncomment-sexp) - ;; Unbind stuff, too. - (dolist (key '("C-M-j" - "M-j")) - (global-set-key (kbd key) nil)) + "C-M-;" #'+lisp-comment-or-uncomment-sexp + "M-j" nil) ;; C-h deletes backward - see https://idiomdrottning.org/bad-emacs-defaults (global-set-key (kbd "C-h") 'delete-backward-char) (keyboard-translate ?\C-h ?\C-?) @@ -55,15 +48,28 @@ (:bind "C-c s" #'+init-sort-then-save) (:hook #'+init-add-setup-to-imenu)) -(setup (:require +key) - (+ensure-after-init #'+key-global-mode)) - (setup (:require +lookup) - (:+key "C-c l" +lookup-map)) + (+lookup-mode +1)) (setup (:require auth-source) (:option auth-sources (list (private/ "authinfo")))) +(setup (:require auto-insert) + (setf (alist-get '("lisp/.*\\.el\\'" . "+Emacs lisp") + auto-insert-alist nil nil #'equal) + `(nil ";;; " (file-name-nondirectory (buffer-file-name)) + (make-string (max 2 (- fill-column (current-column) 27)) 32) + "-*- lexical-binding: t; -*-" '(setq lexical-binding t) + ,(concat "\n\n;;; Commentary:" + "\n\n;; ") _ + ,(concat "\n\n;;; Code:" + "\n\n" + "\n\n(provide '") + (file-name-base (buffer-file-name)) + ,(concat ")" "\n;;; ") + (file-name-nondirectory (buffer-file-name)) " ends here\n")) + (auto-insert-mode +1)) + (setup (:require cus-edit) ;; I don't use Custom to actually /make/ any customizations, but it's handy to ;; (A) see what options are available and (B) persist some changes across @@ -98,28 +104,15 @@ (setup (:require reading) (:global "C-c C-r" #'reading-mode)) +(setup +key + (+ensure-after-init #'+key-global-mode)) + (setup abbrev (:option abbrev-file-name (sync/ "abbrev.el") save-abbrevs 'silent) (:hook-into text-mode circe-chat-mode)) -(setup auto-insert - (setf (alist-get '("lisp/.*\\.el\\'" . "+Emacs lisp") - auto-insert-alist nil nil #'equal) - `(nil ";;; " (file-name-nondirectory (buffer-file-name)) - (make-string (max 2 (- fill-column (current-column) 27)) 32) - "-*- lexical-binding: t; -*-" '(setq lexical-binding t) - ,(concat "\n\n;;; Commentary:" - "\n\n;; ") _ - ,(concat "\n\n;;; Code:" - "\n\n" - "\n\n(provide '") - (file-name-base (buffer-file-name)) - ,(concat ")" "\n;;; ") - (file-name-nondirectory (buffer-file-name)) " ends here\n")) - (auto-insert-mode +1)) - (setup autorevert (:option global-auto-revert-non-file-buffers t auto-revert-verbose nil) @@ -303,6 +296,9 @@ "M-n" nil "M-p" nil)) +(setup flyspell + (:hook-into org-mode)) + (setup hideshow (:also-load +hideshow) (:with-mode hs-minor-mode @@ -558,7 +554,7 @@ [remap isearch-query-replace-regexp] #'anzu-isearch-query-replace-regexp)) (setup (:straight avy) - (:also-load +avy) + (:require avy +avy) (:+key "M-j" #'avy-goto-char-timer) (:bind-into isearch "M-j" #'avy-isearch) @@ -780,7 +776,7 @@ ("M-s u" . consult-focus-lines) ;; Isearch integration ("M-s e" . consult-isearch-history))) - (define-key +key-mode-map (kbd (car binding)) (cdr binding))) + (global-set-key (kbd (car binding)) (cdr binding))) (with-eval-after-load 'isearch-mode (dolist (binding '(("M-e" . consult-isearch-history) ("M-s e" . consult-isearch-history) @@ -813,7 +809,8 @@ (setup (:straight crux) ;; yes it's silly I have an addon to this addon. (:also-load +crux) - (:option crux-shell-func #'crux-eshell) + (:option crux-shell-func #'crux-eshell + +crux-default-date-format "%F") (:global "C-o" #'crux-smart-open-line "C-x 4 t" #'crux-transpose-windows "M-w" #'+crux-kill-ring-save @@ -844,7 +841,7 @@ See also `crux-reopen-as-root-mode'." (autoload 'dictionary-search "dictionary" "Ask for a word and search it in all dictionaries" t) (:hook #'reading-mode) - (define-key +lookup-map "d" #'dictionary-search)) + (define-key +lookup-mode-map "d" #'dictionary-search)) (setup (:straight (discord :host github @@ -949,6 +946,11 @@ See also `crux-reopen-as-root-mode'." :repo "duckwork/filldent.el")) (:+key "M-q" #'filldent-dwim)) +(setup (:straight flyspell-correct) + (:option flyspell-correct--cr-key ";") + (:bind-into flyspell + "C-;" #'flyspell-correct-wrapper)) + (setup (:straight-when (forge :host github :repo "magit/forge") (eq system-system 'linux)) -- cgit 1.4.1-21-gabe81