Vim - Extra space inserted after accented letters or ñ

妖精的绣舞 提交于 2019-12-10 19:54:54

问题


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.

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.

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---------------

  1. coraz´
  2. corazó
  3. corazó n

---------------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---------------

  1. Mañ
  2. Mañ ana

---------------VIM---------------

Does anyone know why this happens?


回答1:


Try adding set encoding=utf-8 to your .vimrc (or just test it out at the : prompt)



来源:https://stackoverflow.com/questions/6965050/vim-extra-space-inserted-after-accented-letters-or-%c3%b1

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