Search code examples
vimkeyboardmouse

How to block arrow keys and the mouse in Vim?


I kinda started right now with Vim... So, I'm using Janus and enjoying it. But it let me use the arrow keys. How can I block them? I would also like to disable completely the mouse. (make it desappear if it's possible)

I really don't know where to put the changes and when I installed Janus it added some different dirs.

This is what i've done so far ~/.vimrc.after/

noremap <Up> <Nop>
noremap <Down> <Nop>
noremap <Left> <Nop>
noremap <Right> <Nop>
set mouse= 
set ttymouse=

It blocked left and right arrows, but still lets me use up and down. Also the mouse.


Solution

  • To disable the arrow keys in ViM add the following lines to your ~/.vimrc file:

    noremap <Up> <Nop>
    noremap <Down> <Nop>
    noremap <Left> <Nop>
    noremap <Right> <Nop>
    

    And for disable the mouse add these lines:

    set mouse=
    set ttymouse=
    

    Enjoy!