SUSE Conversations


Vim-Friendly Keyboard



By: cboltz

January 11, 2008 4:25 pm

Reads:123

Comments:0

Rating:0

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/escape-capslock.map with this content:

include "de-latin1-nodeadkeys.map.gz" # enter your local keytable here

keycode  58 = Escape
    alt keycode  58 = Meta_Escape

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

KEYTABLE="escape-capslock.map"

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

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)

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

Disclaimer: As with everything else at SUSE Conversations, 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.

Comment

RSS