S-RET -> insert literal newline

A convention on many text editors and applications is to make RET
auto-indent new lines. That has already been done. Another convention is
for S-RET to insert an unindented line; this commit adds this convention
to Doom.

Relevant to #3694
This commit is contained in:
Henrik Lissner 2020-08-05 18:02:40 -04:00
parent 9a5175dd0e
commit 863eb82efd
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
5 changed files with 19 additions and 8 deletions

View file

@ -425,10 +425,6 @@
"M-=" #'doom/increase-font-size
"M--" #'doom/decrease-font-size
;;; newlines
[remap newline] #'newline-and-indent
"C-j" #'+default/newline
;;; search
(:when (featurep! :completion ivy)
"C-S-s" #'swiper

View file

@ -50,10 +50,6 @@
(not (memq (char-after) (list ?\( ?\[ ?\{ ?\} ?\] ?\))))))
#'yas-insert-snippet)
;; Smarter newlines
:i [remap newline] #'newline-and-indent ; auto-indent on newline
:i "C-j" #'+default/newline ; default behavior
(:after help :map help-mode-map
:n "o" #'link-hint-open-link)
(:after helpful :map helpful-mode-map

View file

@ -427,6 +427,13 @@ Continues comments if executed from a commented line. Consults
;; 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.
;; auto-indent on newline by default
:gi [remap newline] #'newline-and-indent
;; insert literal newline
:gi "S-RET" #'+default/newline
:gi [S-return] #'+default/newline
:gi "C-j" #'+default/newline
;; add new item below
:gn [C-return] #'+default/newline-below
:gn [C-S-return] #'+default/newline-above
(:when IS-MAC