HOW-TO: Swap Caps Lock and Escape
Swapping Caps Lock and Escape can be very helpful, especially for vim users, as it reduces stress on your fingers.
Instructions for Gnome:
1. System -> Preferences -> Keyboard
2. Select Layouts tab, then Layout Options
3. Click on 'CapsLock key behavior'
4. Click on 'Swap ESC and CapsLock'
That's it.
Re: HOW-TO: Swap Caps Lock and Escape
This works except for the annoying fact that the CapsLock light is still being governed by actual CapsLock presses instead of ESC presses (which would make more sense after the remapping). Is there anyway to get the ESC to control the CapsLock light!? this would seem to be a bug? where would I report it?
My ESC/CapsLock journey thus far for anyone interested in a tale of triumph and tragedy:
I actually had this working properly in Gutsy after some hack on the key mapping files I picked up from a random blog, but boy did that screw up my Hardy upgrade-- I was stuck with permanent CapsLock anytime I happened to touch that button (which by that time had become my muscle-memory's ESC button). All my letters were all caps forever until a full reboot. So then I decided to install Hardy from scratch, in hopes that this nice little option would work correctly. Mostly-- but not quite.
Re: HOW-TO: Swap Caps Lock and Escape
Quote:
Originally Posted by
timo1023
Swapping Caps Lock and Escape can be very helpful, especially for vim users, as it reduces stress on your fingers.
Instructions for Gnome:
1. System -> Preferences -> Keyboard
2. Select Layouts tab, then Layout Options
3. Click on 'CapsLock key behavior'
4. Click on 'Swap ESC and CapsLock'
That's it.
I wonder if there's a way to, instead of *swapping* the keys, have *both* be escape. This aids in the learning the new key position in, for example, 'vi'. When they are swapped, I still keep pressing the real 'esc' key, but it does a caps lock, which is really annoying in 'vi'.
Any idea how to do that?
Max.
Re: HOW-TO: Swap Caps Lock and Escape
Quote:
Originally Posted by
davidmaxwaterman
I wonder if there's a way to, instead of *swapping* the keys, have *both* be escape. This aids in the learning the new key position in, for example, 'vi'. When they are swapped, I still keep pressing the real 'esc' key, but it does a caps lock, which is really annoying in 'vi'.
Any idea how to do that?
Under 9.04 one of the keyboard and layout options instead of "Swap ESC and CapsLock" is "Make CapsLock an additional ESC" which does the trick.
Re: HOW-TO: Swap Caps Lock and Escape
Quote:
Originally Posted by
jonatin
Under 9.04 one of the keyboard and layout options instead of "Swap ESC and CapsLock" is "Make CapsLock an additional ESC" which does the trick.
For me, this option Makes CapsLock an ESC key, and makes ESC do nothing at all. Any ideas on what might be causing that?
Re: HOW-TO: Swap Caps Lock and Escape
Quote:
Originally Posted by
dvhart
For me, this option Makes CapsLock an ESC key, and makes ESC do nothing at all. Any ideas on what might be causing that?
Same for me. :/
Re: HOW-TO: Swap Caps Lock and Escape
Quote:
Originally Posted by
davidmaxwaterman
Same for me. :/
I spent TOO LONG looking into this. Turns out the gnome-keyboard-preferences tool uses XkbOptions via the /etc/init.d/console-setup script and uses /etc/default/console-setup for configuration if you Apply Globally. To make the option work as described in the GUI (making caps lock an ADDITIONAL Escape key - not the ONLY one) you need to edit the Xkb config file here:
/usr/share/X11/xkb/symbols/capslock
as follows:
xkb_symbols "escape" {
key <CAPS> { [ Escape ] };
key <ESC> { [ None ] }; <-- delete this
};
So I found the fix, can someone else open a bug? We should either change the description in the gui tool, or change the xkb file as above (I prefer the latter). I'll try to open a bug if no-one else gets around to it.
Re: HOW-TO: Swap Caps Lock and Escape
Quote:
Originally Posted by
dvhart
So I found the fix, can someone else open a bug? We should either change the description in the gui tool, or change the xkb file as above (I prefer the latter). I'll try to open a bug if no-one else gets around to it.
Thank you very much, amazing find, I love it, makes vim even better imho.