Recreate the Emacs electric-newline-and-maybe-indent feature:
- Insert a newline and, if auto-indent is off, also indent based on filetype/language.
- Keybindings (VSCode/Vim equivalents):
Doom Help:
electric-newline-and-maybe-indent is an interactive and natively
compiled function defined in electric.el.gz.
Signature
(electric-newline-and-maybe-indent)
Documentation
Insert a newline.
If electric-indent-mode is enabled, that's that, but if it
is disabled then additionally indent according to major mode.
Indentation is done using the value of indent-line-function.
In programming language modes, this is the same as TAB.
In some text modes, where TAB inserts a tab, this command indents to the
column specified by the function current-left-margin.
Key Bindings
evil-insert-state-map S-
evil-insert-state-map S-RET
global-map C-j
help-quick-use-map C-j
Demos
[Add]
References
electric-newline-and-maybe-indent is unused in electric.el.gz.
Recreate the Emacs
electric-newline-and-maybe-indentfeature:Doom Help:
electric-newline-and-maybe-indent is an interactive and natively
compiled function defined in electric.el.gz.
Signature
(electric-newline-and-maybe-indent)
Documentation
Insert a newline.
If electric-indent-mode is enabled, that's that, but if it
is disabled then additionally indent according to major mode.
Indentation is done using the value of indent-line-function.
In programming language modes, this is the same as TAB.
In some text modes, where TAB inserts a tab, this command indents to the
column specified by the function current-left-margin.
Key Bindings
evil-insert-state-map S-
evil-insert-state-map S-RET
global-map C-j
help-quick-use-map C-j
Demos
[Add]
References
electric-newline-and-maybe-indent is unused in electric.el.gz.