简体   繁体   English

如何更改重音字符的vim映射

[英]How can I change vim mappings for accented characters

I am trying to change vim mappings for (french) accentuated characters. 我正在尝试更改(法语)重音字符的vim映射。

à (ASCII 133) I would like it to be Alt + a à (ASCII 133)我希望它是Alt + a
À (ASCII 183) I would like it to be Alt + Shift + a À (ASCII 183)我希望它是Alt + Shift + a
é (ASCII 130) I would like it to be Alt + e é (ASCII 130)我希望它是Alt + e
É (ASCII 144) I would like it to be Alt + Shift + e É (ASCII 144)我希望它是Alt + Shift + e

I would be happy to remap the existing maps Alt + i ==> é (why is that?) 我很乐意重新映射现有的地图Alt + i ==> é (为什么?)
How can I get those mappings to work ? 如何使这些映射起作用?

mapping works for theses chars, and the question is about the alt key, which may not work when the terminal prefixes the character with an ESC character. 映射适用于这些字符,问题是关于alt键,当终端在字符前加上ESC字符时,可能无法使用alt键。 type :help map-alt-keys for more informations on that. 输入:help map-alt-keys以获得更多信息。

I just tried in xterm and theses mapping worked: 我只是在xterm中尝试过,因此论文映射起作用了:

:imap <A-a> à
:imap <A-A> À
:imap <A-e> é
:imap <A-E> É

And also, for changing default mapping to another, use "remap" instead of map : 而且,要将默认映射更改为另一个映射,请使用“ remap”而不是map:

:iremap <A-i> whatever 

Edit : see also Alt key shortcuts not working on gnome terminal with Vim 编辑:另请参见Alt键快捷方式在Vim的gnome终端上不起作用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM