问题描述
我有一个关于Vim的问题。我在Mac OS X雪豹和编译vim开始使用编辑器。偶尔我输入其他语言。
I have a question about Vim. I'm on a Mac OS X Snow Leopard and compiled vim to start using the editor. Occasionally I type in other languages.
我发现当使用重音字母键入时,每个字母后会添加一个额外的空格。我也使用Macs西班牙语键盘做我的打字,至少以西班牙语。
I found that when typing in accented letters an extra space is added after each letter. I'm also using the Macs spanish keyboard to do my typing, in spanish at least.
这是发生了什么,
我将键入口音键,使用左括号键(1),[,然后vim将以黄色突出显示当前位置。然后我将键入我的元音(2)。元音然后有口音,但现在vim已经插入一个额外的空格后的字母。我之后键入的任何东西都已经是一个空格了,我被迫退格删除插入的额外空间。(3)
So this is what happens,I'll type the accent key by using the left bracket key (1), [ , and then vim will highlight the current position in yellow. Then I'll type in my vowel(2). The vowel then has the accent on it but now vim has inserted an extra space after the letter. Anything I type afterwards is a space away already and I'm forced to backspace to delete the extra space that was inserted.(3)
------- -------- VIM ---------------
---------------VIM---------------
- coraz'
- corazó
- corazón
----------- VIM ---------------
---------------VIM---------------
同样的事情发生在ñ。
The same thing happens with the ñ. Right after hitting the 'ñ' key, the semi-colon key on a regular qwerty keyboard, an extra space is inserted.
---------在键盘上点击'ñ'键后,分号键会插入一个额外的空格。 ------ VIM ---------------
---------------VIM---------------
- Mañ
- Mañana
--------------- VIM --- ------------
---------------VIM---------------
有没有人知道为什么会发生这种情况?
Does anyone know why this happens?
推荐答案
尝试将 set encoding = utf-8
添加到您的 .vimrc
请在:
提示符下测试)
Try adding set encoding=utf-8
to your .vimrc
(or just test it out at the :
prompt)
这篇关于Vim - 在带重音的字母或ñ之后插入额外的空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!