VIM - How to map Shift-Enter

后端 未结 5 1774
广开言路
广开言路 2020-11-27 16:30

I am trying to customize behaviour of Enter key in Normal mode in VIM. Here is my .vimrc:

nmap  o         


        
5条回答
  •  粉色の甜心
    2020-11-27 17:10

    Ingo Karkat and romainl are 100% correct. However what you are asking is common so I want to give you some options.

    I personally recommend using Tim Pope's Unimpaired plugin. It provides many mappings but the ones you will looking for are [ and ] which create blank lines above and below the current line respectively. Unimpaired also provides nice mappings for moving through the quickfix list, buffer list, option toggling, and many others. See :h unimpaired for more.

    If you do not want to use unimpaired plugin but like the mappings below are some quick mappings to put in your ~/.vimrc file:

    nnoremap  [  :put!=repeat([''],v:count)']+1
    nnoremap  ]  :put =repeat([''],v:count)'[-1
    

提交回复
热议问题