They work just fine if I use Terminal and start a vim session, but under iTerm I have to resort to using H-J-K-L to do left-up-down-right movement.

In both Terminal and iTerm TERM=xterm-color. My .vimrc is quite lean and there are no key bindings set in there that would causing this problem.

iTerm v0.10.


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.
  • I got the same problem on iTerm2. There's no Bookmarks menu :(
    – Wei Hu
    Apr 6 '11 at 0:31
  • 1
    @Wei: They're called Profiles in iTerm2. Profiles -> Open Profiles... and from there you can load the xterm defaults for Keyboard for the profile(s).
    – Ian C.
    Apr 6 '11 at 16:54
  • @Ian, thanks. I found the settings but loading the xterm defaults didn't fix the problem.
    – Wei Hu
    Apr 6 '11 at 22:31
  • @WeiHu: The original suggestion from sentinel was to load the Global setting, not the xterm one, and I expect this carries over to iTerm2 - I'll try as soon as I install iTerm2. I know that Ian C. wrote xterm, but maybe that was a typo. Aug 2 '12 at 22:57
  • For iTerm2, there's a FAQ section: iterm2.com/#/section/faq I use "Report Terminal Type: xterm-256color" together with the default xterm keybindings; you can try the ones from Terminal.app, but keybindings seem to be unrelated. For me the only important thing was to set Alt to behave as +Esc instead of Meta, but that shouldn't apply to arrows (for me, it fixed Alt-B and friends under screen). Aug 4 '12 at 20:35

The following worked for me.

In iTerm2:

  • Profiles -> Open Profiles...
  • Edit Profiles...
  • Keys tab
  • From Load Preset... drop-down, pick Terminal.app compatibility
  • 1
    Thank you Gerald, you are a Gentleman and a Squire. Feb 23 '20 at 1:11
  • This seem to work so far, but I'm wondering what's the root cause ... ) Apr 30 at 8:03

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>


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


I was able to get this sorted out with iTerm2 Build 3.0.15 and the following excerpt from my .vimrc:

" Map alternate key combination for Esc.
noremap <c-[> <Esc>
" Map arrow keys for nomal mode.
nnoremap <silent> <Esc><Up>A <Nop>
nnoremap <silent> <Esc><Down>B <Nop>
nnoremap <silent> <Esc><Right>C <Nop>
nnoremap <silent> <Esc><Left>D <Nop>


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .