Apr 14, 2009

Accents in Vim

I've been working with localization for work lately, and I've had to put a lot of accents in for French. This is not a huge deal since I have this thing on my desktop PC (forgot what it is called) that lets you put RSuper+accent+key to type an accent (RSuper being the right Windows key) - so RSuper+'+e gives you é.

However on my laptop I don't have this set up and having forgotten what it is called, I can't look it up. Never fear though, Vim has a shortcut key for accents. While in insert mode (or in any mode where you can type a character to be outputted, like after pressing 'r') hit Ctrl+k, the letter to accent and then the accent. So to type a é you hit Ctrl+k, then e, then '. Nice and easy! However for some reason they don't do others as easily, è is e then !, and some others are weird like that too. Oh well.

No comments: