Characteristics:
MacOS 10.14.6
I'm using VIM as text editor for a few weeks, with both Terminal
and iTerm2
I could write character dependent on hitting key alt (left alt key in iTerm
) without problem
Ex:
- alt-3 gave the the character "#"
- alt-5 gave the the character "["
- alt-6 gave the the character "]"
But suddenly, it changed and now when hit those shortcuts, it does not write the corresponding character with the left alt key and quits insert mode instead (although the command with the desired output work with the right alt key in iTerm2
. Moreover combinations with both right and left alt key are also working fine in Terminal
). I think that this change came after Vim
or iTerm2
asked me if I wanted to change some shortcuts and I (stupidly) responded yes.
So i conclude that pressing suddenly seems to map to the command Esc
(and not the character "#", How do I change that mapping
I tried the following command without success:
:unmap <Alt-3>
:unmap <Alt-3> Esc
:unmap <press Alt-3>
:unmap <press Alt-3> Esc
:map <A-3> #
:map! <A-3> #
:map <A-"> #
:map! <A-"> #
:set timeout timeoutlen=5000 ttimeoutlen=250
I want be able to write the character "#" with the shortcut Alt-3 (left alt button) in iTerm2
Did I change something by mistake? What should I do to fix the problem? Should I change the ~/vimrc
file
:h :map
). If you're trying bothmap
andmap!
it seems that you're not even sure what mode you want to do the mapping in. Similar comment regardingpress
. It will be easier to help you if you familiarize yourself with that documentation.ESC+
is probably what's causing your problem, so you might want to switch to one of the other settings, see if that fixes it...