Bind Escape key in Tmux
tmux
Solution
If you're on OS X you can achieve this with karabiner.
In your system preferences, change Caps-lock to Control instead of Esc. Then use karabiner to send Esc when you type Control by itself.
- karabiner preferences -> "Change Key" tab
- scroll down to "Change Control_L Key (Left Control)"
- check "Control_L to Control_L (+ When you type Control_L only, send Escape)"
This gives your left pinky easy access to both Esc and Control. You can exit Vim's insert mode the way you already are, and you can set Control+a as your tmux prefix:
set -g prefix C-a
Problem
Since I have my Caps-lock key mapped to Esc (due to Vim), I'd also like it in tmux. Specifically, I'm trying to set Esc + a as the prefix: ``` set -g prefix Escape-a ``` However, this isn't working, and I get the error `bad key: Escape-a`. Is this because Esc is not a modifier key? I'd really like this to work, as Esc is on the home row and very convenient to use.