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: Ctrl-b Alt-1 to Alt-5 pick one tmux pane layout directly

Tmux
~/tips/tip-tmux-layout-presets

Ctrl-b Alt-1 # even-horizontal

Applies a fixed pane layout straight away, with the number of the layout as the key.

Cycling with Space takes a few presses. The Alt-number keys go straight to the layout you want.

Ctrl-b Alt-1    # even-horizontal
Ctrl-b Alt-2    # even-vertical
Ctrl-b Alt-3    # main-horizontal
Ctrl-b Alt-4    # main-vertical
Ctrl-b Alt-5    # tiled

Hold Alt (Option on a Mac, if your terminal sends it as Meta) while pressing the digit after the prefix. Tiled is the one I would use most, because it gives every pane about the same size however many there are.

Main-vertical keeps one large pane on the left and stacks the others on the right. That suits an editor with a few small shells beside it.

On macOS the Option key has to be set to send Escape or Meta in your terminal, otherwise the shortcut never arrives in tmux. Check that setting first if nothing happens.

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