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: set -g mode-keys vi gives tmux copy mode vi keys

Tmux
~/tips/tip-tmux-mode-keys-vi

set -g mode-keys vi

Makes copy mode use vi movement and selection keys instead of the emacs style ones.

If your fingers already know h j k l and /, let copy mode use them.

set -g mode-keys vi

Add the line to ~/.tmux.conf and reload the file. In copy mode you can then move with h j k l, jump with g and G, and search with /.

tmux picks the style from the EDITOR and VISUAL variables when you set neither option, and chooses vi when the value contains vi. Setting mode-keys yourself removes that guessing.

The status line prompt has its own option, status-keys. Set it too if you want vi style editing in the Ctrl-b : prompt.

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. Nothing else on your machine is touched.

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