~/.dotfiles · keybindings

Keybindings

Every key this repo sets, grouped by the layer that catches it first: window manager → multiplexer → terminal → editor → shell.

This page is partly generated. Six regions are rewritten from the tracked configs by ./update-keybindings.sh; everything outside the fences is hand-written. Run ./update-keybindings.sh --check to verify it is current (./setup-validate.sh does this for you).

Terms like leader, prefix, mode and chord are defined in CONTEXT.md. Two things to know before reading the tables:

Quick reference

ActionKeysWhere
Copy / pasteCmd+C / Cmd+VGhostty, Alacritty
Multiplexer prefixCtrl+Atmux
Toggle pane zoomCmd+B, or prefix+zGhostty → tmux
New session popupprefix+Ctrl+ntmux
Lazygit popupprefix+Ctrl+ytmux
Session pickerprefix+Ctrl+j, prefix+wtmux
Restore session (tmux-resurrect)prefix+Ctrl+rtmux — not yazi, see Gotchas
Scratch shell popupprefix+Ctrl+ttmux
Edit ~/.zshrc in nvimprefix+Ctrl+ztmux
Focus paneprefix+h/j/k/l, Shift+arrowstmux
Split side-by-sideprefix+v, prefix+%tmux
Split stackedprefix+s, prefix+'tmux
Next / previous windowprefix+n/p, Ctrl+Right/Lefttmux
Reload tmux configprefix+rtmux
Focus windowAlt+h/j/k/lAeroSpace
Move windowAlt+Shift+h/j/k/lAeroSpace
Switch workspaceAlt+1…Alt+9AeroSpace
Tiling layout / accordionAlt+/ / Alt+,AeroSpace
Format bufferSpace f sNeovim
Diagnostics refreshSpace d r rNeovim
Directory suggestionCtrl+Fzsh

Layer 1 — Window manager (AeroSpace)

AeroSpace owns the outermost layer: it lays out macOS windows and switches workspaces, so these keys work no matter which app has focus. Bindings live in per-mode tables in aerospace.toml.

Focus & navigate

KeyActionMode
alt-hfocus leftmain
alt-jfocus downmain
alt-kfocus upmain
alt-lfocus rightmain

Switch mode

KeyActionMode
alt-shift-hjoin-with left, mode mainservice
alt-shift-jjoin-with down, mode mainservice
alt-shift-kjoin-with up, mode mainservice
alt-shift-ljoin-with right, mode mainservice
alt-shift-rmode resizemain
alt-shift-semicolonmode servicemain
backspaceclose-all-windows-but-current, mode mainservice
entermode mainresize
escmode mainresize
escreload-config, mode mainservice
flayout floating tiling, mode mainservice

Move & swap

KeyActionMode
alt-shift-hmove leftmain
alt-shift-jmove downmain
alt-shift-kmove upmain
alt-shift-lmove rightmain

Layout

KeyActionMode
alt-commalayout accordion horizontal verticalmain
alt-slashlayout tiles horizontal verticalmain

Sessions & workspaces

KeyActionMode
alt-1workspace 1main
alt-2workspace 2main
alt-3workspace 3main
alt-4workspace 4main
alt-5workspace 5main
alt-6workspace 6main
alt-7workspace 7main
alt-8workspace 8main
alt-9workspace 9main
alt-bworkspace Bmain
alt-eworkspace Emain
alt-mworkspace Mmain
alt-nworkspace Nmain
alt-pworkspace Pmain
alt-shift-1move-node-to-workspace 1main
alt-shift-2move-node-to-workspace 2main
alt-shift-3move-node-to-workspace 3main
alt-shift-4move-node-to-workspace 4main
alt-shift-5move-node-to-workspace 5main
alt-shift-6move-node-to-workspace 6main
alt-shift-7move-node-to-workspace 7main
alt-shift-8move-node-to-workspace 8main
alt-shift-9move-node-to-workspace 9main
alt-shift-bmove-node-to-workspace Bmain
alt-shift-emove-node-to-workspace Emain
alt-shift-mmove-node-to-workspace Mmain
alt-shift-nmove-node-to-workspace Nmain
alt-shift-pmove-node-to-workspace Pmain
alt-shift-tmove-node-to-workspace Tmain
alt-shift-tabmove-workspace-to-monitor --wrap-around nextmain
alt-shift-vmove-node-to-workspace Vmain
alt-tworkspace Tmain
alt-tabworkspace-back-and-forthmain
alt-vworkspace Vmain
rflatten-workspace-tree, mode mainservice

Other

KeyActionMode
alt-shift-ffullscreenmain
bbalance-sizesresize
equalresize smart +50resize
hresize width -50resize
jresize height +50resize
kresize height -50resize
lresize width +50resize
minusresize smart -50resize

Layer 2 — Multiplexer (tmux)

tmux sits inside the terminal. The prefix is Ctrl+A (changed from the default Ctrl+B), so every prefixed key is Ctrl+A then the second key.

Focus & navigate

KeyCommandSource
(switch-client -pinherited
)switch-client -ninherited
0select-window -t :=0inherited
1select-window -t :=1inherited
2select-window -t :=2inherited
3select-window -t :=3inherited
4select-window -t :=4inherited
5select-window -t :=5inherited
6select-window -t :=6inherited
7select-window -t :=7inherited
8select-window -t :=8inherited
9select-window -t :=9inherited
Downselect-pane -Dinherited
Lswitch-client -ldeclared
Leftselect-pane -Linherited
Mselect-pane -Minherited
M-nnext-window -ainherited
M-pprevious-window -ainherited
Rightselect-pane -Rinherited
Upselect-pane -Uinherited
\'command-prompt -T window-target -p index { select-window -t ":%%" }inherited
\;last-paneinherited
hselect-pane -Ldeclared
kselect-pane -Udeclared
lselect-pane -Rdeclared
mselect-pane -minherited
nnext-windowinherited
oselect-pane -t :.+inherited
pprevious-windowinherited
wchoose-tree -Zwinherited

Split

KeyCommandSource
*new-paneinherited
\"split-window -v -c "#{pane_current_path}"declared
\%split-window -h -c "#{pane_current_path}"declared
ssplit-window -v -c "#{pane_current_path}"declared
vsplit-window -h -c "#{pane_current_path}"declared

Move & swap

KeyCommandSource
!break-paneinherited
.command-prompt -T target { move-window -t "%%" }inherited
<swap-window -t -1 \; select-window -t -1declared
>swap-window -t +1 \; select-window -t +1declared
C-orotate-windowinherited
Jchoose-tree -Z -F "#{E:@custom_choose_tree_format}" "join-pane -v -s %%"declared
M-orotate-window -Dinherited
\{swap-pane -Udeclared
\}swap-pane -Ddeclared
bif-shell " [ #{window_panes} -gt '1' ] " { break-pane -a }declared
jchoose-tree -Z -F "#{E:@custom_choose_tree_format}" "join-pane -h -s %%"declared

Resize

KeyCommandSource
C-Downresize-pane -Ddeclared
C-Leftresize-pane -Ldeclared
C-Rightresize-pane -Rdeclared
C-Upresize-pane -Udeclared
M-Downresize-pane -D 5inherited
M-Leftresize-pane -L 5inherited
M-Rightresize-pane -R 5inherited
M-Upresize-pane -U 5inherited
S-Downresize-pane -D 5declared
S-Leftresize-pane -L 5declared
S-Rightresize-pane -R 5declared
S-Upresize-pane -U 5declared
zresize-pane -Zinherited

Layout

KeyCommandSource
M-1select-layout even-horizontalinherited
M-2select-layout even-verticalinherited
M-3select-layout main-horizontalinherited
M-4select-layout main-verticalinherited
M-5select-layout tiledinherited
M-6select-layout main-horizontal-mirroredinherited
M-7select-layout main-vertical-mirroredinherited
Spaceselect-layout -ndeclared

Popups & launchers

KeyCommandSource
C-jdisplay-popup -E -T " Switch Session " -h "40%" -w "40%" "tmux list-sessions | sed -E 's/:.*$//' | grep -v \"^$(tmux display-message -p '#S')$\" | fzf --reverse | xargs tmux switch-client -t"declared
C-ndisplay-popup -E -h "20%" -w "40%" "bash -c \"read -p \\\"New session name: \\\" name && [ -n \\\"\\\$name\\\" ] && tmux new-session -d -s \\\"\\\$name\\\" && tmux switch-client -t \\\"\\\$name\\\"\""declared
C-tdisplay-popup -E -d "#{pane_current_path}" -h "75%" -w "75%" zshdeclared
C-ydisplay-popup -E -d "#{pane_current_path}" -h "90%" -w "90%" lazygitdeclared
C-zdisplay-popup -E -h "80%" -w "80%" "nvim ~/.zshrc"declared

Sessions & workspaces

KeyCommandSource
\$command-prompt -I "#S" { rename-session "%%" }inherited

Files & buffers

KeyCommandSource
-delete-bufferinherited

Copy mode & buffers

KeyCommandSource
C-lsend-keys C-linherited
PPagecopy-mode -uinherited
[copy-modeinherited
]paste-buffer -pinherited
drun-shell "tmux send-keys -t vpn C-c 2>/dev/null; sleep 0.3; tmux send-keys -t vpn C-c 2>/dev/null; tmux detach-client"declared

Reload & session persistence

KeyCommandSource
C-rrun-shell ~/.tmux/plugins/tmux-resurrect/scripts/restore.shdeclared
C-srun-shell ~/.tmux/plugins/tmux-resurrect/scripts/save.shinherited
rsource-file ~/.tmux.conf \; display-message "🔄 tmux config reloaded!"declared

Command prompt

KeyCommandSource
,command-prompt -I "#W" { rename-window "%%" }inherited
/command-prompt -k -p key { list-keys -1N "%%" }inherited
:command-promptinherited
?list-keys -Ninherited
Ccustomize-mode -Zinherited
fcommand-prompt { find-window -Z "%%" }inherited

Detach & buffers

KeyCommandSource
&confirm-before -p "kill-window #W? (y/n)" kill-windowinherited
=choose-buffer -Zinherited
\#list-buffersinherited
xconfirm-before -p "kill-pane #P? (y/n)" kill-paneinherited

Other

KeyCommandSource
C-brun-shell "workmux sidebar"declared
Dchoose-client -Zdeclared
DCrefresh-client -cinherited
Erun-shell "\"~/.tmux/plugins/tmux-agent-sidebar/bin/tmux-agent-sidebar\" toggle-all"inherited
Irun-shell ~/.tmux/plugins/tpm/bindings/install_pluginsinherited
M-urun-shell ~/.tmux/plugins/tpm/bindings/clean_pluginsinherited
Rrefresh-client \; display-message "🔄 Display refreshed!"declared
Urun-shell ~/.tmux/plugins/tpm/bindings/update_pluginsinherited
\~show-messagesinherited
cnew-windowinherited
erun-shell "\"~/.tmux/plugins/tmux-agent-sidebar/bin/tmux-agent-sidebar\" toggle \"#{window_id}\" \"#{pane_current_path}\""inherited
idisplay-messageinherited
qdisplay-panesinherited
tclock-modeinherited

Layer 3 — Terminals

Three terminals are configured: Ghostty, Alacritty and WezTerm. Ghostty is the default (per ghostty/config) and the only one with multiplexer-aware bindings.

Ghostty

Multiplexer pass-through

KeyValue
cmd+btext:\x01\x7a
cmd+stext:\x01\x73

Clipboard

KeyValue
super+ccopy_to_clipboard
super+vpaste_from_clipboard

Alacritty

Clipboard

KeyAction
CCopy
VPaste

WezTerm

wezterm/.wezterm.lua sets fonts, theme and performance options and defines no keybindings — WezTerm's own defaults apply unchanged.

Layer 4 — Editor (Neovim)

LazyVim-based, defined across nvim/lua/. Mappings come in three forms: vim.keymap.set and map() calls in config/customize.lua, vim.keymap.set calls in plugin specs, and table-literal key lists.

Files & buffers

KeyActionMode
<S-Tab>Previous buffern
<Tab>Next buffern

Clipboard

KeyActionMode
SPACEpPaste without replacing the default registern, v

Edit

KeyActionMode
DDelete to the vois register.n

Jump & project

KeyActionMode
SPACEjcJump to componentn
SPACEjsJump to stylesn
SPACEjtJump to templaten

Folds

KeyActionMode
zMClose All Foldsn
zROpen All Foldsn
zmClose Folds With Leveln
zrOpen Folds Except Kindsn

LSP & diagnostics

KeyActionMode
SPACEvrRename variable (LSP)n

AI agents

KeyActionMode
<C-a>Ask OpenCode…n, x
<C-x>Select OpenCode…n, x

Other

KeyActionMode
<C-j><Esc>oi
<Esc>Exit terminal modet
<S-C-d>inline functionn
<S-C-u>inline functionn
<Space>-n
<c-h>-plugin
<c-j>-plugin
<c-k>-plugin
<c-l>-plugin
Finline functionn
SPACEa-plugin
SPACEa<cmd>lua requiren, v
SPACEaa-plugin
SPACEab-plugin
SPACEac-plugin
SPACEad-plugin
SPACEas-plugin
SPACEb<cmd>lua requiren, v
SPACEcn<cmd>lua requiren, v
SPACEcp<cmd>lua requiren, v
SPACEd<cmd>lua requiren, v
SPACEfd<cmd>lua requiren, v
SPACEff<cmd>lua requiren, v
SPACEfsinline functionn, v, i
SPACEoa-plugin
SPACEpr<cmd>lua requiren, v
SPACEsp<cmd>lua requiren, v
SPACEt<cmd>lua requiren, v
SPACEupinline functionn
goinline functionn, x
gooinline functionn
hsHorizontal Splitn
te:tabedit")n
vsVerticle Splitn
zMrequiren
zRrequiren

Layer 5 — Shell (zsh)

Other

KeyWidget
^F_directory_suggestion_widget

The widget itself — a fzf-backed directory picker — is defined in zsh/.local/share/zsh/functions.zsh.

Gotchas

Appendix — inherited keymaps

The tools below are reachable from the bindings above (lazygit and yazi via tmux popups, fzf inside the zsh widget) but define no keybindings in this repo. Their keys come from the tools' own defaults, so they’re documented upstream rather than restated here — restating them here would risk claiming bindings this repo doesn’t actually control.

ToolReached fromKeys documented at
lazygitprefix+Ctrl+yjesseduffield/lazygit
yazinot currently reachable — see Gotchassxyazi/yazi
fzfCtrl+F widget, prefix+Ctrl+j pickerjunegunn/fzf