brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: bind -r makes a tmux key repeat without pressing the prefix again

Tmux
~/tips/tip-tmux-repeatable-binding

bind -r L resize-pane -R 5

Lets you press a key several times after one prefix, which suits resizing and moving.

Resizing a pane in small steps means pressing the prefix before every step. A repeatable binding removes that.

bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5

The -r flag marks a binding as repeatable. After Ctrl-b H you can press H again within the repeat time and the pane keeps growing to the left.

The window for repeating is set by repeat-time, 500 milliseconds by default. Raise it, for example with set -g repeat-time 800, if it feels too short.

Pressing any other key ends the repeat. A key that is not part of a repeatable binding is treated as normal input to the pane.

Try it without risk: start a throwaway session with tmux new -s scratch, use the shortcut or command above there, look at what changes, and close it again with tmux kill-session -t scratch.

Further reading: tmux manual page (OpenBSD, official), tmux wiki: Getting Started (official)

More Tmux tips tmux new -d -s report -x 200 -y 50 'top' tmux wait-for build-done set -g allow-passthrough on tmux kill-server Ctrl-b [ All Tmux tips (125) All topics

Link