How to break a line in vim in normal mode?

后端 未结 8 669
梦谈多话
梦谈多话 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:23

    Per this duplicate question: How do I insert a linebreak where the cursor is without entering into insert mode in Vim?

    From within vim, type:

    :map g i[Ctrl+V][Enter][Ctrl+V][Esc][Enter]
    

    This maps the G key to macro I [Enter] [Escape]

提交回复
热议问题