Rethink how we standardize modified RET
C-RET / C-S-RET = add new "item" below/above On MacOS s-RET / S-s-RET = add new line below/above Elsewhere M-RET / M-S-RET = add new line below/above
This commit is contained in:
parent
20b397362b
commit
2387f56ba1
1 changed files with 14 additions and 9 deletions
|
@ -184,8 +184,6 @@
|
|||
:g "s-/" (λ! (save-excursion (comment-line 1)))
|
||||
:n "s-/" #'evil-commentary-line
|
||||
:v "s-/" #'evil-commentary
|
||||
:gni [s-return] #'+default/newline-below
|
||||
:gni [S-s-return] #'+default/newline-above
|
||||
:gi [s-backspace] #'doom/backward-kill-to-bol-and-indent
|
||||
:gi [s-left] #'doom/backward-to-bol-or-indent
|
||||
:gi [s-right] #'doom/forward-to-last-non-comment-or-eol
|
||||
|
@ -288,12 +286,19 @@
|
|||
;; 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
|
||||
;; Standardize the behavior of M-RET/M-S-RET as a "add new item
|
||||
;; below/above" key.
|
||||
:gni [M-return] #'+default/newline-below
|
||||
:gni [M-S-return] #'+default/newline-above
|
||||
;; Standardizes the behavior of modified RET to match the behavior of
|
||||
;; other editors, particularly Atom, textedit, textmate, and vscode, in
|
||||
;; which ctrl+RET will add a new "item" below the current one and
|
||||
;; cmd+RET (Mac) / meta+RET (elsewhere) will add a new, blank line below
|
||||
;; the current one.
|
||||
:gni [C-return] #'+default/newline-below
|
||||
:gni [C-S-return] #'+default/newline-above))
|
||||
:gni [C-S-return] #'+default/newline-above
|
||||
(:when IS-MAC
|
||||
:gni [s-return] #'+default/newline-below
|
||||
:gni [S-s-return] #'+default/newline-above)
|
||||
(:unless IS-MAC
|
||||
:gni [M-return] #'+default/newline-below
|
||||
:gni [M-S-return] #'+default/newline-above)))
|
||||
|
||||
|
||||
;;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue