143 words
1 minute
Some tmux Tricks

Alternative Prefix#

There is a well-known trick to re-map <Caps> to <Esc> when tapped and <Ctrl> when held. This trick saves us from lifting our hands to reach the <Esc> or <Ctrl> key. But it do bring up another problem: <Caps-a> is too hard to press. To resolve this, we may further map <Caps-;> to <Ctrl-a>. This is a smart solution, because it can make use of a invalid key-combo and is very easy to press.

I use keyd do all these re-mapping. Below is my config:

/etc/keyd/keyd.conf
[ids]
*
[main]
# Make <Caps> work as <Esc> when tapped and <Ctrl> when held.
capslock = overload(capslock, esc)
[capslock:C]
# Map <Caps-;> behave like <Ctrl-a> (for GNU screen and tmux).
; = C-a

Then in my tmux config, I have:

$XDG_CONFIG_HOME/tmux/tmux.conf
unbind-key C-b
set-option -g prefix C-a
bind-key C-a send-prefix

which changes the prefix to <Ctrl-a> and can be triggered by <Caps-;>.

Some tmux Tricks
https://johnsmith0x3f.github.io/posts/tmux-tricks/
Author
johnsmith0x3f
Published at
2025-08-02
License
CC BY-NC-SA 4.0