I currently have Caps Lock mapped to Ctrl when held and Esc when tapped (for vim) via these commands in .xinitrc
setxkbmap -option 'caps:ctrl_modifier'
xcape -e 'Caps_Lock=Escape'
This works, but leaves me without Caps Lock so I want to remap Esc to Caps Lock.
I've tried setting it with xmodmap -e 'keycode 9 = Caps_Lock' but that overrides the mapping on the Caps Lock key as well.
Is there any way to achieve these mappings?
Caps Lock -> Ctrl and Esc
Esc -> Caps Lock