tanketorsken.dk/2010/12/

Feeds

Paste from clipboard to gvim

Sometimes I need to paste something from the clipboard to gvim. The content of the clipboard is saved in the register *, so the command

"*p

does the job.

Remap keys in Ubuntu

I’ve just installed Ubuntu and wanted to remap a few keys system wise. The xmodmap command is useful for this task. First you need to find the keycode for the key you want to remap and the keysym that the key should be remapped to.

$  xmodmap -pk | less

When you have found the keycode and the keysym you just enter

$ xmodmap -e 'keycode <keycode> = <keysym>'

and then the key is remapped.

EDIT 08-04-2011:
Use the command xev to find the keycode for the key you want to remap. If I want to change the key that is the half fraction on my Lenovo I type in

$ xmodmap -e 'keycode 49=dollar'