17

I have the following lines in my .vimrc.

 " Arrows are unvimlike 

 nnoremap <up> <nop>
 nnoremap <down> <nop>
 nnoremap <left> <nop>
 nnoremap <right> <nop>
 inoremap <up> <nop>
 inoremap <down> <nop>
 inoremap <left> <nop>
 inoremap <right> <nop>

I understand that the arrow keys are made no operations to force the use of j,k,h,l.But why is there two sets of what seems like same commands.Or in other words what is the difference between nnoremap and inoremap and why both of them are used.

1

1 Answer 1

35

You are making sure the arrow keys are nop for both insert and normal mode

From: the Vim Wikia page:

n  Normal mode map. Defined using ':nmap' or ':nnoremap'.
i  Insert mode map. Defined using ':imap' or ':inoremap'.
1
  • 4
    See also :help map-modes. Apr 3, 2014 at 21:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.