tags:

views:

1102

answers:

3

Hey,

How do I map my Windows key (which is defined as the Meta_L key in Ubuntu) so that it also works as the Control_L key in Vim? When I have my laptop docked, the Windows key is closer to my pinky, so I'd like the option to use that as the control key as well.

+1  A: 
Mykola Golubyev
+1  A: 

Looks like Ctrl and Alt are hard-coded into in the Vim source. You can map your Windows key to Ctrl globally if you don't mind affecting all other programs too. Some window managers will support doing this, or else you can use xmodmap. The Vim wiki has some info about mapping the Windows key to another Escape, which is similar.

Brian Carper
A: 

As an alternative to using xmodmap and if you're using GNOME, you can go into the Control Center → Keyboard Preferences → Layout Options → Alt/Win behaviour → Control is mapped to the Win Key. (alternatively, run gnome-keyboard-properties)

Of course, this changes it for everything, not just vim.

Steve Pomeroy