Vim insert strange characters when trying to fix Alt key

早过忘川 提交于 2019-12-13 07:19:09

问题


I found the workaround for mapping Alt key on gnome-terminal in this topic. After editing the vimrc file, my Vim now recognizes Alt-j as ê (which is a non-english character), how can I fix it?

Thanks


回答1:


As explained in the referenced topic, for Vim, Alt + character combinations are represented by ASCII characters with the 8th bit set, which is identical to certain special characters (such as ê). As long as you don't need to type those characters (e.g. because you write in French :-), you can ignore this curiosity; just write your mapping with either <A-j> or the literal ê notation (but after any :set encoding=... in your .vimrc, because that affects how these are interpreted).



来源:https://stackoverflow.com/questions/14557144/vim-insert-strange-characters-when-trying-to-fix-alt-key

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!