Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
    
linux.die.net/man/1/xmodmap –  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

1 Answer 1

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
Super+h


Command 2
sleep 0.1 && xdotool key "Down"

Shortcut 2
Super+j


Command 3
sleep 0.1 && xdotool key "Up"

Shortcut 3
Super+k


Command 4
sleep 0.1 && xdotool key "Right"

Shortcut 4
Super+l


Hope you enjoy ;-)

share|improve this answer

Your Answer

 
discard

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.