Reputation: 5952
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.
Upvotes: 9
Views: 16712
Reputation: 181
This sequence:
set-option -g prefix Escape
unbind-key C-b
bind-key Escape send-prefix
...works for me. I'm using tmux-2.0
Upvotes: 18
Reputation: 6322
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.
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
Upvotes: 9
Reputation:
I think this is not possible because Esc
and a
are 2 distinct keys. From what I know tmux doesn't allow key bindings with more than 1 key (for anything).
This is different from having, for example Ctrl-a
as a prefix. Even though we type 2 keyboard keys to get it - ^A
is represented as a single character by both tmux and vim.
Upvotes: 7