betabug... Sascha Welter

home english | home deutsch | Site Map | Sascha | Kontakt | Pro | Weblog | Wiki

31 December 2005

Greek in vim with langmap - only ISO-8859-7

Still not there yet for UTF-8

In a comment to my old post about State of Greek and UTF-8 in the Mac OS X Terminal Andreas Triantafillidis asks if I finally managed to use vim with Greek. Answer: The state is still somehow the same. Using a vim with multilingual capabilities compiled in, I can read and write in Greek, but not as good as I want, because mapping of keyboard commands does not work with Unicode, but read on for what I got with ISO-8859-7...

Tassos Pavlakos (in another comment to that post) had suggested vim's langmap command, which is the right tool for the job. But typing :help langmap in vim gives us the following information:

This only works for 8-bit characters. The value of 'langmap' may be specified with multi-byte characters (e.g., UTF-8), but only the lower 8 bits of each character will be used.
This maps right with my experience. Trying to use the langmap feature with Greek in UTF-8 will leave vim just beeping at you.

So today I tried a small experiment. The Mac OS X does not offer ISO-8859-7 in its list of default encodings (and at least for Mac OS X 10.3 there is no way to change that list through the GUI). So I tweaked the rules a bit to see if I could get it to work, here are the steps I took:

So, what does that show us? With a bit of quirky hacking and the right version / compilation settings of vim, we can read and write unhindered in Greek, as long as it's ISO-8859-7 Greek. Which is kind of funny, since vim claims to be UTF-8 internally. But I guess that's just the way the langmap command and it's underlying architecture are implemented. If the terminal software you use supports ISO-8859-7 it's not even that difficult to try it out (I don't know about Linux/BSD terminal apps, my trials are on the Mac). I don't think I will like it though, since I believe the time for the ISO encodings is over, I became a Unicode believer. Last remark: This is vim 6.1, once I'm back on the net I will check out if anything has changed in newer versions.

Posted by betabug at 13:57 | Comments (1) | Trackbacks (0)
ch athens
Life in Athens (Greece) for a foreigner from the other side of the mountains. And with an interest in digital life and the feeling of change in a big city. Multilingual English - German - Greek.
Main blog page
Recent Entries
Best of
Some of the most sought after posts, judging from access logs and search engine queries.

Apple & Macintosh:
Security & Privacy:
Misc technical:
Athens for tourists and visitors:
Life in general:
<< Books... and Bookshops in Athens | Main | Happy New Year! Guet's Neus! Καλή χρονιά! >>
Re: Greek in vim with langmap - only ISO-8859-7

thanks sascha ... i'll try it and let you know if successfull ('d be glad to buy you a beer or such anytime)


Posted by: Andreas Triantafillidis at December 31,2005 17:34
You can trackback to:
vim, Greek, and utf-8 Keyboard Commands

Trying something I wanted to play around with for a long time, I made
more progress in setting up vim to work with Greek. As seen in the
previous posts about this topic there are some prerequisites to get this
working (especially on Mac OS X). To get keyboard commands work with the
greek keyboard too, you can use the map keyboard command, it's a bit
more tedious than langmap, but you can put it into your .vimrc and have
it always ready. Read on for details...

Read the linking post here: ch-athens at January 08,2006 12:41