mirror of
https://github.com/doomemacs/doomemacs.git
synced 2026-05-11 14:27:15 -07:00
tweak(default): use electric-indent instead of remapping RET
This is experimental. electric-indent was initially avoided to sidestep breaking indentation in whitespace-significant major modes with naive indent logic. Switching to electric-indent will resurface that issue, but since electric-indent-mode is on by default, I'll leave that to the modes and modules to deal with on a per-mode basis.
This commit is contained in:
parent
d9711a9094
commit
7d0f2032ea
2 changed files with 6 additions and 12 deletions
|
|
@ -1,8 +1,5 @@
|
|||
;;; config/default/autoload/text.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload
|
||||
(defalias '+default/newline #'electric-indent-just-newline)
|
||||
|
||||
;;;###autoload
|
||||
(defun +default/newline-above ()
|
||||
"Insert an indented new line before the current one."
|
||||
|
|
|
|||
|
|
@ -544,9 +544,9 @@ Continues comments if executed from a commented line."
|
|||
:gi "TAB" cmds-tab
|
||||
:gi [tab] cmds-tab))
|
||||
|
||||
;; 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.
|
||||
;; Smarter readline keybinds (C-a/C-e) for both Emacs and Evil. Changes C-a to
|
||||
;; also cycle between true BOL and BOI (indentation). Same for C-e, but with
|
||||
;; EOL and EOI (ignoring comments+trailing whitespace).
|
||||
(map! :gi "C-a" #'doom/backward-to-bol-or-indent
|
||||
:gi "C-e" #'doom/forward-to-last-non-comment-or-eol
|
||||
;; Standardizes the behavior of modified RET to match the behavior of
|
||||
|
|
@ -559,12 +559,9 @@ Continues comments if executed from a commented line."
|
|||
;; C-<mouse-scroll-down> = text scale decrease
|
||||
[C-down-mouse-2] (cmd! (text-scale-set 0))
|
||||
|
||||
;; auto-indent on newline by default
|
||||
:gi [remap newline] #'newline-and-indent
|
||||
;; insert literal newline
|
||||
:i "S-RET" #'+default/newline
|
||||
:i [S-return] #'+default/newline
|
||||
:i "C-j" #'+default/newline
|
||||
;; Do opposite of `electric-indent-mode'
|
||||
:i "S-RET" #'electric-newline-and-maybe-indent
|
||||
:i [S-return] #'electric-newline-and-maybe-indent
|
||||
|
||||
;; Add new item below current (without splitting current line).
|
||||
:gi "C-RET" #'+default/newline-below
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue