How can I map `Ctrl+Alt+Char` and `Ctrl+Number` in vim on Mac OSX? 1.Enviroment

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

2. Mapping Problem

In mac, mappings for &lt;A-char&gt; won't directly work in mac.

:inoremap &lt;A-u&gt; type some string A-u
:inoremap &lt;A-p&gt; type some string A-p
:inoremap
i  õ           * type some string A-u
i  ð           * type some string A-p


As far as I know about &lt;A-char&gt; in mac, hit &lt;A-u&gt; will print nothing but with a sound alert. hit &lt;A-p&gt; will print π. I found that map for π works well.

:inoremap π type some string A-p


Is it possible to map &lt;A-u&gt; in vim? Yes!
Let me  go into  this problem deeply:

:map &lt;A-S-p&gt; not work
:map ∏ works well(A-S-p will print `∏`)

:map &lt;C-A-p&gt; not work
:map &lt;C-π&gt; still not work

:map &lt;C-S-p&gt; do work
:map &lt;C-1&gt; not work


So , is it possible to map Ctrl-Alt-char and Ctrl+Number?



Of course, you can use fastcodes in vimfastcodes in vim. Refer to https://stackoverflow.com/questions/23606892/vim-keyboard-mapping-problems-in-mac/23608928#23608928
If you use MacVim, the easiest way is:

set macmeta


So that MacVim will treat alt/option as Meta key, you can then bind:

nmap &lt;C-M-S&gt; :call foo_func()


The keys pressed for above is: Ctrl+alt+s.

Hope this helps and solves your issue, happy Vimming!