Vim-Friendly Keyboard

By: cboltz

January 11, 2008 4:25 pm





Vim is the fastest editor I know because you can operate it with the keyboard. Only the long distance to the Escape key is annoying. But Linux would not be Linux if you could not change the keyboard mapping yourself.

IMHO the CapsLock key is quite superfluous. Therefore I have mapped Escape to the CapsLock key and use the even more superfluous Break key for CapsLock functionality.

Changing the keyboard mapping is easy. First create ~/.Xmodmap with this content:

!! map CapsLock functionality to the "Break" key
keycode 110 =  Caps_Lock

!! map Escape to the CapsLock key
keycode 66 =  Escape

!! clear CapsLock and map it on "Break"
clear Lock
add Lock = Caps_Lock

Then you have to make sure that .Xmodmap is loaded at login. The KDE keyboard settings tend to overwrite earlier settings, therefore I load my .Xmodmap late enough in a script inside the KDE autostart folder:

xmodmap /home/cb/.Xmodmap

If you want to modify the keymap of the virtual consoles also (this time without changing Break), create the file /usr/share/kbd/keymaps/i386/qwertz/ with this content:

include "" # enter your local keytable here

keycode  58 = Escape
    alt keycode  58 = Meta_Escape

Then change your keyboard layout in /etc/sysconfig/keyboard:


That’s it. With this little change of the keyboard layout, working with vim is more comfortable and faster.

0 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 5 (0 votes, average: 0.00 out of 5)
You need to be a registered member to rate this post.

Tags: ,
Categories: SUSE Linux Enterprise Desktop, Technical Solutions

Disclaimer: As with everything else in the SUSE Blog, this content is definitely not supported by SUSE (so don't even think of calling Support if you try something and it blows up).  It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.