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.

5 Answers 5


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
    Commented Apr 6, 2011 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.
    Commented Apr 6, 2011 at 16:54
  • @Ian, thanks. I found the settings but loading the xterm defaults didn't fix the problem.
    – Wei Hu
    Commented Apr 6, 2011 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. Commented Aug 2, 2012 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). Commented Aug 4, 2012 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. Commented Feb 23, 2020 at 1:11
  • This seem to work so far, but I'm wondering what's the root cause ... ) Commented Apr 30, 2021 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>



The fastest (and probably best) way to solve this is to switch iterm profile keymapping to "Natural editing" preset.

  1. Go to preferences
  2. Go to profiles
  3. Go to keys
  4. Go to keymappings
  5. From preset dropdown select natural editing preset

You must log in to answer this question.

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