Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to achieve a remapping of keys in a way that simulates the vi flow of having editing mode and command mode. In Windows, it can be achieved as explained in the site. In the comments, it is suggested a way that might work in Linux, but I can't put it to work.
To better explain what I want, this is an example of the effects with the Windows solution:
I'm editing something in notepad. If I press f, it should type an "f" letter. However if I press CAPS + f, then it should move a line down (CAPS was configured as the command key).

share|improve this question – user606723 Jul 23 '11 at 14:47
@user606723: I know you can remap keys, but that's not what I'm asking. I've edited the question trying to put it clearer. – julio.g Jul 25 '11 at 19:05
I am pretty sure you everything that you want with xmodmap.... Wait you want to have two different modes? hmm – user606723 Jul 25 '11 at 22:41
@user606723: So I don't have to reach for the arrow keys while typing. Exactly the same as the vi key binding works. If can be done with xmodmap, can you provide a simple example? – julio.g Jul 26 '11 at 18:45
up vote 1 down vote accepted

Well, at the link you provided, Paul explain how did he made it.
A slight modified way to do this would be like this:

1) Alt + F2 and type gnome-keyboard-properties.
Then go to Layouts > Options > Caps Lock key Behavior > "Make Caps Lock an additional Super"

2) Install compizconfig settings manager and xdotool.

3) Open ccsm (Alt + F2 and type `ccsm).
Then go to Commands and set these commands and these shortcuts:

Command 1
sleep 0.1 && xdotool key "Left"

Shortcut 1

Command 2
sleep 0.1 && xdotool key "Down"

Shortcut 2

Command 3
sleep 0.1 && xdotool key "Up"

Shortcut 3

Command 4
sleep 0.1 && xdotool key "Right"

Shortcut 4

Hope you enjoy ;-)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.