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 | and – to split tmux panes with keys that make sense

Tmux
~/tips/tip-tmux-split-keys

bind | split-window -h

Replaces the default split keys with a pipe for side by side and a dash for stacked.

The default split keys are % and ". It is hard to remember which of the two splits which way.

bind | split-window -h
bind - split-window -v

The pipe looks like a vertical line, so it splits left and right. The dash looks like a horizontal line, so it splits top and bottom. Add the lines to ~/.tmux.conf and reload.

The old keys keep working unless you remove them with unbind % and unbind '"'. Keeping them does no harm while you get used to the new ones.

To also keep the new pane in the current folder, add -c "#{pane_current_path}" to both lines.

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