VIM - How to map Shift-Enter

后端 未结 5 1772
广开言路
广开言路 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 16:55

    I also wanted to map and found that I couldn't get it to work in CLI mode until I added a second mapping using Ctrl+V then for the mapped keystroke. The mapping is still needed for GVIm to work as expected, however. This would render the your .vimrc snippet as follows:

    nnoremap  o
    nnoremap  i " Needed for GVIm
    nnoremap ^[0M i   " Needed for CLI VIm (Note: ^[0M was created with Ctrl+V Shift+Enter, don't type it directly)
    

    I tested this on Ubuntu 12.04. Happy Vimming!

提交回复
热议问题