Revise C-a/C-e/C-u/C-w/C-b/C-f keybinds
+ C-b/C-f/C-w/C-u are from vim, and so will only be set for evil users. + C-a/C-e exists in both vim and Emacs, so we make them smarter for both users.
This commit is contained in:
parent
681145e6b5
commit
93c537e6a7
2 changed files with 13 additions and 12 deletions
|
@ -808,15 +808,13 @@ customized by changing `+default-repeat-forward-key' and
|
||||||
;; Universal evil integration
|
;; Universal evil integration
|
||||||
|
|
||||||
(when (featurep! :feature evil +everywhere)
|
(when (featurep! :feature evil +everywhere)
|
||||||
;; Restore C-a, C-e and C-u and make them a little smarter. C-a will jump to
|
;; Have C-u behave similarly to `doom/backward-to-bol-or-indent'.
|
||||||
;; indentation. Pressing it again will send you to the true bol. Same goes for
|
;; NOTE SPC u replaces C-u as the universal argument.
|
||||||
;; C-e, except it will ignore comments+trailing whitespace before jumping to
|
(map! :gi "C-u" #'doom/backward-kill-to-bol-and-indent
|
||||||
;; eol. C-u will act similarly to C-a.
|
:gi "C-w" #'backward-kill-word
|
||||||
(define-key!
|
;; Vimmish ex motion keys
|
||||||
"C-a" #'doom/backward-to-bol-or-indent
|
:gi "C-b" #'backward-word
|
||||||
"C-e" #'doom/forward-to-last-non-comment-or-eol
|
:gi "C-f" #'forward-word)
|
||||||
"C-u" #'doom/backward-kill-to-bol-and-indent
|
|
||||||
"C-w" #'backward-kill-word)
|
|
||||||
|
|
||||||
(after! view
|
(after! view
|
||||||
(define-key view-mode-map [escape] #'View-quit-all))
|
(define-key view-mode-map [escape] #'View-quit-all))
|
||||||
|
|
|
@ -141,9 +141,6 @@
|
||||||
"A-x" #'execute-extended-command)
|
"A-x" #'execute-extended-command)
|
||||||
|
|
||||||
(define-key!
|
(define-key!
|
||||||
;; Ensure Emacsien motions are available
|
|
||||||
"C-b" #'backward-word
|
|
||||||
"C-f" #'forward-word
|
|
||||||
;; Buffer-local font scaling
|
;; Buffer-local font scaling
|
||||||
"M-+" (λ! (text-scale-set 0))
|
"M-+" (λ! (text-scale-set 0))
|
||||||
"M-=" #'text-scale-increase
|
"M-=" #'text-scale-increase
|
||||||
|
@ -170,6 +167,12 @@
|
||||||
;; textmate-esque deletion
|
;; textmate-esque deletion
|
||||||
[M-backspace] #'doom/backward-kill-to-bol-and-indent)
|
[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)
|
(if (featurep 'evil)
|
||||||
(load! "+evil-bindings")
|
(load! "+evil-bindings")
|
||||||
(load! "+emacs-bindings")))
|
(load! "+emacs-bindings")))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue