Env: vim+zsh+iTerm2 on Mac OSX 10.9.2. (Same problems in vim+terminal+bash on Mac OSX 10.9.2)

2. Mapping Problems

Here are mapping problems list(You can chose any of them to anwser).

My vim could not get some shortcuts: <A-Left|Right|..>,<D-char>.

2.1 <A-Left|Right|UP|Down

In iTerm2 , hitting <A-Left|... will result in(iTerm2 doesn't bind any shortcut for them.):

<A-Up> print 'A' with a sound alert.
<A-Down> print 'B' with a sound alert.
<A-Left> print 'D' with a sound alert.
<A-Down> print 'C' with a sound alert.

In vim, <A-Left|... behave same as <Left><Right><Up><Down> in insert mode , normal mode, visual mdoe and Ex Mode, etc. Could I map them <A-Left|..>?

2.2 <D-char>

Some keys about <D-char> are iTerms's own hotkeys, such as :

  1. <D-q> will quit iTerm2
  2. <D-w> will close current tab in iTerm2

On the other hand, the other keys such as <D-s> are not hotkey, and do not print any char in vim and terminal. Is it possible to map them in vim?

  • 2
    This site works better if there is only one problem per question. Can you please either generalize your problem (e.g. "How can I keep keybindings of iTerm and vim apart") or focus on one of the questions you have here (and ask others for the rest)?
    – nohillside
    Commented May 14, 2014 at 16:36
  • @patrix Following your suggestion, I've cutted my problems to three parts: 1. How to keep keybindings of iTerm and vim apart. 2. How map <C-A-char>. 3. Mapping problem about <C-q> in terminal
    – ahuigo
    Commented May 14, 2014 at 17:20

1 Answer 1


I prefer to not change any mappings in iterm and use .vimrc for all mappings as it’s simpler and generally more effective. It also lets you use terminal app

Once that’s set, you could easily ask specific follow on questions for specific key sequences.

Arrow keys are particularly vexsome in some versions of iterm.

You must log in to answer this question.

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