Search code examples
vimkeyboardmappingkeyboard-shortcuts

Pressing <press Alt-3> suddenly maps to Esc (and not the character "#"


Pressing suddenly seems to map to the command Esc (and not the character "#", How do I access the map.

I tried the following command:

:unmap <Alt-3>
:unmap <Alt-3> Esc
:unmap <press Alt-3>
:unmap <press Alt-3> Esc

I want be able to write the character "#" with the shortcut Alt-3


Solution

  • The problem was in your iTerm configuration, which was set to send ESC+3 when <Alt-3> was pressed.

    You can solve the problem be going to iTerm2 menu Preferences > Profiles > Keys and setting Left Option (alt) Key there, changing from "Esc+" to "Normal".