Vim split line command

Viewed 63560
7 Answers

rEnter while on whitespace will do it. That's two keystrokes.

I don't think that there is a single key command for this. The best you can do with stock vim is probably i Enter Esc.

No. I've now read enough answers to conclude that there is no such command.

Easy answer: Pressing 'Enter' while in insert will do it; but you're right, there oughtta be a key for it in command mode. I've wondered, too.

Since everyone has a favorite workaround, I will share mine. The assumption is that I will do anything to avoid having to reach for the Esc key.

ylprX ... where 'X' is the inserted character, which can even be a newline.

So, 'yl' is yank on char to the right, 'p' = paste the char, 'r' is replace that char; then you just type the new char. That's how much I hate using Escape.

(That was 'l', as in "move right", BTW)

Jed's answer is most useful. I would like to add that I needed the "control-V-alternative", i.e. control-Q: %s/;/^q^m/g

Related