How to break a line in vim in normal mode?

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

    Try this:

    :nnoremap <NL> i<CR><ESC>
    

    then just press Ctrl-J whenever you want to split a line.

    0 讨论(0)
  • 2021-01-31 08:41

    Similar to other answers but doesn't replace the current character.

    R<enter>

    No remaps required.

    0 讨论(0)
提交回复
热议问题