3

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?

Mat
  • 202,337
  • 40
  • 393
  • 406
Jerry Saravia
  • 3,737
  • 3
  • 24
  • 39

1 Answers1

3

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

ib.
  • 27,830
  • 11
  • 80
  • 100
Alex
  • 14,973
  • 13
  • 59
  • 94
  • This doesn't seem to work. I set this both at the prompt and the .vimrc. I tried closing vim after setting it in the rc file to make sure the changes took but the extra space is still being inserted. – Jerry Saravia Aug 06 '11 at 14:45
  • What do you get when you type `:set encoding?` – Alex Aug 06 '11 at 16:46
  • I think that the version I compiled didn't have enough features. I tried set encoding=utf-8 and nothing changed as I mentioned. I then tried set encoding? as you just suggested and got an error about the option not existing. Then I recompiled vim with the 'huge' feature set and did this again and it works perfectly now. Thank you. – Jerry Saravia Aug 07 '11 at 01:47
  • 1
    Yup! That was precisely the problem. The 'normal' feature set doesn't support the encoding option. – Jerry Saravia Aug 07 '11 at 02:02