I am trying to customize behaviour of Enter
key in Normal
mode in VIM.
Here is my .vimrc
:
nmap o
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