feat(core): use general.el for keybind definitions nearly everywhere

Primarily this replaces :bind with :general in all use-package calls.
This commit is contained in:
2022-03-14 20:58:06 +00:00
parent 3fc0d2d77d
commit a8618938bf
91 changed files with 665 additions and 632 deletions

View File

@@ -9,9 +9,9 @@
(require 'siren-ido)
(use-package amx
:bind
("M-x" . amx)
("C-x C-m" . amx)
:general
("M-x" 'amx)
("C-x C-m" 'amx)
:custom
(amx-backend 'ido)

View File

@@ -11,11 +11,11 @@
(use-package auto-highlight-symbol
:diminish auto-highlight-symbol-mode
:bind
(:map auto-highlight-symbol-mode-map
("C-c C-p" . ahs-backward)
("C-c C-n" . ahs-forward)
("C-c C-r" . ahs-edit-mode))
:general
(:keymaps 'auto-highlight-symbol-mode-map
"C-c C-p" 'ahs-backward
"C-c C-n" 'ahs-forward
"C-c C-r" 'ahs-edit-mode)
:hook
(prog-mode . auto-highlight-symbol-mode)

View File

@@ -10,10 +10,10 @@
(require 'siren-consult)
(use-package embark
:bind
(("C-." . embark-act) ;; pick some comfortable binding
("C-," . embark-dwim) ;; good alternative: M-.
("C-h B" . embark-bindings)) ;; alternative for `describe-bindings'
:general
("C-." 'embark-act) ;; pick some comfortable binding
("C-," 'embark-dwim) ;; good alternative: M-.
("C-h B" 'embark-bindings) ;; alternative for `describe-bindings'
:config
;; Hide the mode line of the Embark live/completions buffers

View File

@@ -10,18 +10,20 @@
;; http://www.lukeswart.net/2015/04/lightning-intro-to-emacs-using-evil-mode-and-org-mode/
(use-package evil
:demand
:bind (:map evil-normal-state-map
;; Treat wrapped line scrolling as single lines.
("j" . evil-next-visual-line)
("k" . evil-previous-visual-line)
;; esc quits pretty much anything (like pending prompts in the minibuffer)
:map evil-normal-state-map ("<escape>" . keyboard-quit)
:map evil-visual-state-map ("<escape>" . keyboard-quit)
:map minibuffer-local-map ("<escape>" . minibuffer-keyboard-quit)
:map minibuffer-local-ns-map ("<escape>" . minibuffer-keyboard-quit)
:map minibuffer-local-completion-map ("<escape>" . minibuffer-keyboard-quit)
:map minibuffer-local-must-match-map ("<escape>" . minibuffer-keyboard-quit)
:map minibuffer-local-isearch-map ("<escape>" . minibuffer-keyboard-quit)))
:general
(:keymaps 'evil-normal-state-map
;; Treat wrapped line scrolling as single lines.
"j" 'evil-next-visual-line
"k" 'evil-previous-visual-line)
;; esc quits pretty much anything (like pending prompts in the minibuffer)
(:keymaps 'evil-normal-state-map "<escape>" 'keyboard-quit)
(:keymaps 'evil-visual-state-map "<escape>" 'keyboard-quit)
(:keymaps 'minibuffer-local-map "<escape>" 'minibuffer-keyboard-quit)
(:keymaps 'minibuffer-local-ns-map "<escape>" 'minibuffer-keyboard-quit)
(:keymaps 'minibuffer-local-completion-map "<escape>" 'minibuffer-keyboard-quit)
(:keymaps 'minibuffer-local-must-match-map "<escape>" 'minibuffer-keyboard-quit)
(:keymaps 'minibuffer-local-isearch-map "<escape>" 'minibuffer-keyboard-quit))
(provide 'siren-evil)
;;; siren-evil.el ends here

View File

@@ -9,9 +9,9 @@
(use-package hideshow
:straight (:type built-in)
:bind
("C-=" . siren-folding-toggle-selective-display)
("C-c C-h" . siren-folding-toggle)
:general
("C-=" 'siren-folding-toggle-selective-display)
("C-c C-h" 'siren-folding-toggle)
:init
(defun siren-folding (&optional arg)

View File

@@ -9,10 +9,10 @@
(use-package highlight-symbol
:diminish highlight-symbol-mode
:bind
("C-c C-p" . highlight-symbol-prev)
("C-c C-n" . highlight-symbol-next)
("C-c C-r" . highlight-symbol-query-replace)
:general
("C-c C-p" 'highlight-symbol-prev)
("C-c C-n" 'highlight-symbol-next)
("C-c C-r" 'highlight-symbol-query-replace)
:hook
(prog-mode . highlight-symbol-mode)

View File

@@ -10,8 +10,8 @@
(use-package ivy
:defer t
:bind
("C-c C-r" . ivy-resume)
:general
("C-c C-r" 'ivy-resume)
:custom
(ivy-use-virtual-buffers nil)

View File

@@ -8,8 +8,9 @@
(use-package marginalia
:demand t
:bind (:map minibuffer-local-map
("M-A" . marginalia-cycle))
:general
(:keymaps 'minibuffer-local-map
"M-A" 'marginalia-cycle)
:custom
(marginalia-align-offset 10)

View File

@@ -7,9 +7,9 @@
;;; Code:
(use-package mwim
:bind
("C-a" . mwim-beginning)
("C-e" . mwim-end))
:general
("C-a" 'mwim-beginning)
("C-e" 'mwim-end))
(provide 'siren-mwim)
;;; siren-mwim.el ends here

View File

@@ -7,11 +7,11 @@
;;; Code:
(use-package smex
:bind
("C-x C-m" . smex)
("C-c C-m" . smex)
("M-X" . smex-major-mode-commands)
("C-c C-c M-x" . execute-extended-command)
:general
("C-x C-m" 'smex)
("C-c C-m" 'smex)
("M-X" 'smex-major-mode-commands)
("C-c C-c M-x" 'execute-extended-command)
:custom
(smex-save-file (expand-file-name "smex-items" siren-cache-dir))

View File

@@ -8,13 +8,13 @@
(use-package undo-tree
:demand
:bind
(:map undo-tree-map
("C-x u" . undo-tree-visualize)
("M--" . undo-tree-undo)
("M-_" . undo-tree-redo)
("s-z" . undo-tree-undo)
("s-Z" . undo-tree-redo))
:general
(:keymaps 'undo-tree-map
"C-x u" 'undo-tree-visualize
"M--" 'undo-tree-undo
"M-_" 'undo-tree-redo
"s-z" 'undo-tree-undo
"s-Z" 'undo-tree-redo)
:diminish
undo-tree-mode

View File

@@ -30,15 +30,15 @@
(use-package vertico-repeat
:after vertico
:bind
("C-c C-v" . vertico-repeat))
:general
("C-c C-v" 'vertico-repeat))
(use-package vertico-directory
:after vertico
:demand t
:bind
(:map vertico-map
("C-l" . vertico-directory-up))
:general
(:keymaps 'vertico-map
"C-l" 'vertico-directory-up)
:init
;; Hacky minor-mode to toggle vertico-directory features on and off.