Skip to content

Rebinding keys

[keys.root] holds keys that work without the prefix; [keys.prefix] holds the keys you press after it. Write only the keys you change; the rest keep their defaults (bmux default-config lists them). "none" unbinds a key: a root key then reaches the application, and a prefix key does nothing.

[keys.root]
"C-l" = "none"            # Ctrl-l clears the shell; Ctrl-a arrows still move right
"A-h" = "navigate-left"   # Alt-h/j/k/l as well as Ctrl-h/j/k/l

[keys.prefix]
"v" = "split-right"
"s" = "split-down"
"w" = "sessions"
"H" = "resize-left"       # repeats with plain H, like h does by default

Keys are written like Helix’s: C- Ctrl, A- Alt, S- Shift, then a character or one of left, right, up, down, home, end, pageup, pagedown, ins, del, backspace, tab, ret, esc, space, minus (or "-"), F1 to F12. Uppercase letters are shifted keys; Ctrl-Shift letters are the same as Ctrl letters in most terminals.

Action Default key What it does
navigate-left / -down / -up / -right root C-h/j/k/l Focus a pane, or move between Vim/Neovim splits
focus-left / -down / -up / -right prefix arrows Focus a pane, even with an editor in front
next-pane prefix o Cycle panes
resize-left / -down / -up / -right prefix h/j/k/l Move a divider five cells; prefix keys bound to resize repeat without the prefix for a second
split-right / split-down prefix | / - Split side by side / stacked
zoom, close-pane prefix m, x
last-pane, swap-pane-previous / swap-pane-next, rotate-window prefix ;, { / }, C-o
break-pane, join-pane prefix !, @ Join goes into the last window, beside its focused pane
next-layout, equalize-layout prefix space, E
layout-even-horizontal, layout-even-vertical, layout-main-horizontal, layout-main-vertical, layout-tiled prefix A-1 … A-5
new-window, close-window, rename-window prefix c, &, R New window in the focused pane’s directory; close asks first if a program is running
next-window / previous-window, last-window prefix ] / [, tab
select-window-1 … select-window-9 prefix 1 … 9
sessions, new-session, last-session prefix s, n, p new-session opens the popup that finds a project’s session or creates one
previous-session / next-session prefix ( / )
detach, copy, scrollback, search-scrollback prefix d, y, v, / scrollback opens the keyboard scrollback view; search-scrollback opens it with a search prompt
scroll-up / scroll-down root S-pageup / S-pagedown Ten lines of history
toggle-sidebar, reload-config, help, integrations, settings prefix b, r, ?, i, , help lists the bindings in effect; integrations opens the integrations panel; settings opens the settings page
send-prefix the prefix again Send the prefix key to the application

The prefix can’t be a root key. The status line’s hints and the prefix help show your bindings.

A key can run a shell command instead of an action, like tmux’s bind g run-shell '…':

[keys.prefix]
"g" = "run-shell bmux split -h -- lazygit"   # lazygit in a new split
"T" = "run-shell make test"                   # the last line shows in the notice box
"N" = 'run-shell bmux new-window -c "$BMUX_PANE_PATH" -- nvim'
"L" = "run-shell bmux pipe-pane -o 'cat >> ~/${BMUX_SESSION}-${BMUX_PANE}.log'"  # toggle logging

The server runs the command for the focused pane, in the background, the way it runs hooks: BMUX_* metadata environment variables (BMUX_SESSION, BMUX_SESSION_ID, BMUX_PANE, BMUX_PANE_PATH, BMUX_WINDOW_NAME, BMUX_PANE_TITLE, …) and shell-escaped #{...} variables filled in, in the pane’s directory, for up to a minute. The last line it prints shows in the notice box, or what went wrong if it fails. For a long-running program, start it in a pane (bmux split -- …, bmux new-window -- …) so the key returns at once. Ctrl-a ? lists these keys with their commands.