16

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.

liv2hak
  • 14,472
  • 53
  • 157
  • 270
  • possible duplicate of [What is the difference between the remap, noremap, nnoremap and vnoremap mapping commands in vim?](http://stackoverflow.com/questions/3776117/what-is-the-difference-between-the-remap-noremap-nnoremap-and-vnoremap-mapping) – cfi Sep 22 '15 at 09:28

1 Answers1

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'.
Steven Schmatz
  • 86
  • 1
  • 11
brokenfoot
  • 11,083
  • 10
  • 59
  • 80