betabug... Sascha Welter

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

03 December 2009

Map ex Commands in vim

... for example for a different keyboard layout

In vim, Greek, and utf-8 Keyboard Commands, Giorgos had asked in a comment if it would be possible to not only switch vi's keyboard shortcuts to a Greek keyboard, but also to use Greek letters for ex commands. For example to be able to write for :w. Yes, that's possible, do something like the following in your .vimrc file:

cab γ w
cab κ q
cab γκ wq
cab ε e

Due to the use of cab for these "abbreviations" (that's what the ab is for), they will work only in the command mode. There are some limitations. First of all, when entering you will not see it replace with :w right away (you can hit space to see it replaced), but it will work. Also if you have ex command lines with a single ε somewhere in them for example, you could get into trouble, as vim would continue to change that to an "e". I will not be using this myself for this reason.

Posted by betabug at 15:15 | 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:
<< (Farb)negativ | Main | Blonde Hits Bus >>
Re: Map ex Commands in vim

Thanks so much! That was very helpful!

Posted by: Giorgos at December 06,2009 04:59
You can trackback to:
There are no trackbacks.