How can I keep keybindings of iTerm and vim apart 1.Enviroment

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: &lt;A-Left|Right|..&gt;,&lt;D-char&gt;.

2.1 &lt;A-Left|Right|UP|Down

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

&lt;A-Up&gt; print 'A' with a sound alert.
&lt;A-Down&gt; print 'B' with a sound alert.
&lt;A-Left&gt; print 'D' with a sound alert.
&lt;A-Down&gt; print 'C' with a sound alert.


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

2.2 &lt;D-char&gt;

Some keys about &lt;D-char&gt; are iTerms's own hotkeys, such as :


&lt;D-q&gt; will quit iTerm2
&lt;D-w&gt; will close current tab in iTerm2


On the other hand, the other keys such as &lt;D-s&gt; are not hotkey, and do not print any char in vim and terminal. Is it possible to map them in vim?
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. 


Why don&#39;t my arrow keys work in vim under iTerm?