I find I don’t really miss the right alt key at all.
xcape -e 'Control_L=Escape'
which is run after remapping caps lock to Control_L via xmodmap (just xmodmap -pke to create your xmodmap file, xev to figure out which keycode your caps is, and edit the file after to make that keycode Control_L.For example my xmodmap file, which also sets up meta/super and other overrides is
!
! Clear the modifiers
!
clear lock
clear shift
clear control
clear mod1
clear mod2
clear mod3
clear mod4
clear mod5
! Remapping
keycode 37 = F17 NoSymbol F17
keycode 64 = Alt_L NoSymbol Alt_L
keycode 66 = Control_L NoSymbol Control_L
keycode 90 = Multi_key NoSymbol Multi_key
keycode 91 = Mode_switch NoSymbol Mode_switch
keycode 105 = Meta_R NoSymbol Meta_R
keycode 107 = Menu Sys_Req Menu Sys_Req
keycode 108 = Control_R NoSymbol Control_R
keycode 127 = Redo Undo Redo Undo
keycode 134 = Alt_R NoSymbol Alt_R
keycode 135 = Control_R NoSymbol Control_R
keycode 164 = Undo Redo Undo
keycode 166 = Super_L NoSymbol Super_L
keycode 167 = Control_L NoSymbol Control_L
!
! Set the modifiers
!
add shift = Shift_L Shift_R
add control = Control_L Control_R
add mod1 = Alt_L Alt_R
add mod2 = Num_Lock
add mod3 = Super_L
add mod4 = Meta_R
add mod5 = Mode_switchI suspect you'd have to switch to something like Autohotkey for the Esc/Ctrl mapping.
Or there's always dual binding Caps Lock (tapped vs held) as tetraodonpuffer suggested but I've never been able to get used to that.
Oh, and on Mac CTRL+ALT+5 if I remember correctly.
Some alt based sequences are really useful:
* alt + e, a : leave current parenthesis and continue inserting (eg, while typing parameters for a function)
* alt + shift + a : insert mode at the end of current line
* alt + shift + i : insert mode at the beginning of current line, with indentation
* alt + p, a : paste before current position, and continue inserting
Maybe there's a modifier key with a similar behavior on macosx?
Why does that work? Is it because Alt + some_key combos generate an escape sequence starting with the actual ESC character? I know that happens with many function key combos, don't remember or not sure about Alt combos.
Ha, I probably found it by some similar way, maybe in vim or maybe in DOS / Windows / Linux at the command prompt or in some curses or terminal application.
Is that different from just Shift-a or capital A, which puts you into append mode at the end of the current line (no matter where you are on the line when you press it)?
I find it easier to stick to the laptop keyboard and trackpad even when at a desk plugged into a big monitor.
Everytime I try to switch to a mechanical keyboard and mouse my wrists start hurting. I guess this would go if I got used to the position but then what would happen when I have to use the laptop keyboard?
(So far I’ve tried an IBM model-m and a Pok3r keyboard).
Don't worry about switching back to the laptop keyboard on the go. You won't be less productive, you will just enjoy it less :)