diff --git a/modules/config/default/+evil-bindings.el b/modules/config/default/+evil-bindings.el index 23df1f3bc..b706e112d 100644 --- a/modules/config/default/+evil-bindings.el +++ b/modules/config/default/+evil-bindings.el @@ -808,15 +808,13 @@ customized by changing `+default-repeat-forward-key' and ;; Universal evil integration (when (featurep! :feature evil +everywhere) - ;; Restore C-a, C-e and C-u and make them a little smarter. C-a will jump to - ;; indentation. Pressing it again will send you to the true bol. Same goes for - ;; C-e, except it will ignore comments+trailing whitespace before jumping to - ;; eol. C-u will act similarly to C-a. - (define-key! - "C-a" #'doom/backward-to-bol-or-indent - "C-e" #'doom/forward-to-last-non-comment-or-eol - "C-u" #'doom/backward-kill-to-bol-and-indent - "C-w" #'backward-kill-word) + ;; Have C-u behave similarly to `doom/backward-to-bol-or-indent'. + ;; NOTE SPC u replaces C-u as the universal argument. + (map! :gi "C-u" #'doom/backward-kill-to-bol-and-indent + :gi "C-w" #'backward-kill-word + ;; Vimmish ex motion keys + :gi "C-b" #'backward-word + :gi "C-f" #'forward-word) (after! view (define-key view-mode-map [escape] #'View-quit-all)) diff --git a/modules/config/default/config.el b/modules/config/default/config.el index 09e10fedc..7c8f6e82b 100644 --- a/modules/config/default/config.el +++ b/modules/config/default/config.el @@ -141,9 +141,6 @@ "A-x" #'execute-extended-command) (define-key! - ;; Ensure Emacsien motions are available - "C-b" #'backward-word - "C-f" #'forward-word ;; Buffer-local font scaling "M-+" (λ! (text-scale-set 0)) "M-=" #'text-scale-increase @@ -170,6 +167,12 @@ ;; textmate-esque deletion [M-backspace] #'doom/backward-kill-to-bol-and-indent) + ;; Smarter C-a/C-e for both Emacs and Evil. C-a will jump to indentation. + ;; Pressing it again will send you to the true bol. Same goes for C-e, except + ;; it will ignore comments+trailing whitespace before jumping to eol. + (map! :gi "C-a" #'doom/backward-to-bol-or-indent + :gi "C-e" #'doom/forward-to-last-non-comment-or-eol) + (if (featurep 'evil) (load! "+evil-bindings") (load! "+emacs-bindings")))