How to break a line in vim in normal mode?

2019-03-09 16:58发布

I would like to break a line (at the location of the cursor) in to two lines without leaving normal mode (entering insert or command-line mode). Is this possible?

I currently get to the location I want and hit 'i' to enter insert mode, 'enter' to break the line in two, then 'esc' to return to normal mode.

I am not trying to set a maximum line length or do any syntax or anything like that. I just want to break one line into two lines without leaving normal mode. 'J' joins the line the cursor is on to the line below it, which is handy. I want the opposite -- to break one line into two with a single command.

标签: vim macvim
7条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-03-09 17:17

put cursor in position and...

  r<Enter>
查看更多
登录 后发表回答