Why don't my arrow keys work in vim under iTerm?

Try the following:

  1. From the Bookmarks menu item, select Manage Bookmarks....
  2. Choose the Default bookmark and click the edit icon.
  3. Change the Keyboard setting to Global.

The following worked for me.

In iTerm2:

  • Profiles -> Open Profiles...
  • Edit Profiles...
  • Keys tab
  • From Load Preset... drop-down, pick Terminal.app compatibility

This is how I fixed:

nnoremap <silent> <ESC>^[A <Nop>
nnoremap <silent> <ESC>^[B <Nop>
nnoremap <silent> <ESC>^[D <Nop>
nnoremap <silent> <ESC>^[C <Nop>

Note:

The "^[" characters must not be typed, instead you get them by doing: -V and pressing the corresponding cursor arrow position (up,down,left,right).

Tested with: iTerm2 (Build 1.0.0.20140629)