How to break a line in vim in normal mode?

后端 未结 8 527
梦谈多话
梦谈多话 2021-01-31 08:08

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 curr

8条回答
  •  孤独总比滥情好
    2021-01-31 08:24

    As far as I know this isn't possible without entering insert mode. You can however macro it with something like (replace Z with whatever key you want to use)

    nmap Z ik$
    

    basically this maps the key 'Z' to enter insert mode 'i', insert a carriage return '', leave insert mode '', go up a line 'k' and finally go to the end of the line '$'

提交回复
热议问题