In Spacemacs, how do I insert a new line without entering insert mode?

In Vim, you can bind the Enter key to insert a new line without entering insert mode . how can you do this in Spacemacs.

Or how to reassign keys in general in Spacemacs?

+5
source share
2 answers

You can use:

 (define-key evil-normal-state-map (kbd "RET") 'spacemacs/evil-insert-line-below) 

to insert the line below and stay in the same position, or

 (define-key evil-normal-state-map (kbd "RET") (lambda () (interactive) (call-interactively 'spacemacs/evil-insert-line-below) (evil-next-line))) 

to insert a line below and go to a new line.

+9
source

You can also insert a new line in Spacemacs while remaining in the normal state with the extremely useful spacemacs/evil-insert-line-below command.

It is tied to SPC i j in Vim mode and Mm i j in Emacs mode.

Assuming a command with a numeric argument inserts more than one new line, for example. 4 SPC i j will insert four new rows.

+9
source

Source: https://habr.com/ru/post/1241678/


All Articles