tmux-which-key

February 22, 2026 ยท View on GitHub

A LazyVim-style which-key popup for tmux. Press a trigger key to open a discoverable, keyboard-driven command menu with nested groups, breadcrumb navigation, and Nord-themed colors.

Nord theme tmux

tmux-which-key screenshot

Features

  • Discoverable keybindings - see all available commands at a glance
  • Nested groups - organize commands hierarchically (git, window, session, etc.)
  • Breadcrumb navigation - always know where you are in the menu tree
  • Nord color theme - clean, readable color scheme using 24-bit true color
  • JSON configuration - easy to customize, extend, and share
  • Five action types - shell commands (with optional auto-execute), tmux commands, external scripts, popups, and nested groups
  • Single-keystroke input - no Enter key required, instant response

Requirements

  • tmux >= 3.3 (for display-popup support)
  • jq (for JSON parsing)
  • A terminal with true color (24-bit) support

Installation

Add to your ~/.tmux.conf:

set -g @plugin 'Nucc/tmux-which-key'

Then press prefix + I to install.

Manual

Clone the repository:

git clone https://github.com/Nucc/tmux-which-key.git ~/.tmux/plugins/tmux-which-key

Add to your ~/.tmux.conf:

run-shell ~/.tmux/plugins/tmux-which-key/which-key.tmux

Reload tmux:

tmux source-file ~/.tmux.conf

Usage

Press prefix + Space (default) to open the which-key popup.

  • Press a key to execute the corresponding command or enter a group
  • Escape to go back one level or close the menu
  • Backspace to go back one level or close the menu

Groups are indicated by a + prefix and shown in cyan. Pressing a group key opens its submenu with a breadcrumb showing your navigation path.

Configuration

Tmux Options

Set these in your ~/.tmux.conf before loading the plugin:

OptionDefaultDescription
@which-key-triggerSpaceKey binding (after prefix) to open the menu
@which-key-config(auto-detected)Path to a custom JSON config file
@which-key-popup-height16Popup height in lines
@which-key-popup-width100Popup width in characters
@which-key-popup-bg#2E3440Popup background color
@which-key-popup-fg#4C566APopup border/foreground color
@which-key-popup-xCPopup X position (C = centered)
@which-key-popup-ySPopup Y position (S = status line)

Example:

set -g @which-key-config '~/.config/tmux-which-key/config.json'
set -g @which-key-popup-height '20'
set -g @which-key-popup-width '120'
set -g @plugin 'Nucc/tmux-which-key'

Custom Key Binding

By default the plugin binds prefix + Space. You can override this with @which-key-trigger, or create your own binding entirely in ~/.tmux.conf.

To bind Ctrl-Space directly (no prefix needed):

# Disable the default prefix binding
set -g @which-key-trigger 'None'

# Bind Ctrl-Space directly (-n = no prefix)
bind-key -n C-Space run-shell 'tmux display-popup -E -h 16 -w 100 -x C -y S -S "fg=#4C566A" -s "bg=#2E3440" "~/.tmux/plugins/tmux-which-key/scripts/which-key.sh #{pane_id}"'

To use a custom config with a manual binding:

bind-key -n C-Space run-shell 'tmux display-popup -E -h 16 -w 100 -x C -y S -S "fg=#4C566A" -s "bg=#2E3440" "~/.tmux/plugins/tmux-which-key/scripts/which-key.sh --config ~/.config/tmux-which-key/config.json #{pane_id}"'

Custom Config File

The plugin looks for a config file in this order:

  1. Path set via @which-key-config tmux option
  2. $XDG_CONFIG_HOME/tmux-which-key/config.json (usually ~/.config/tmux-which-key/config.json)
  3. ~/.tmux-which-key.json
  4. Plugin's built-in configs/default.json

To create your own config:

mkdir -p ~/.config/tmux-which-key
cp ~/.tmux/plugins/tmux-which-key/configs/default.json ~/.config/tmux-which-key/config.json

Then edit ~/.config/tmux-which-key/config.json to your liking.

Config File Format

The config file is a JSON object with a top-level items array. Each item has:

FieldTypeRequiredDescription
keystringyesSingle character that triggers this item
typestringyesOne of: group, action, tmux, script, popup
descriptionstringyesLabel shown in the menu
commandstringfor non-groupsCommand to execute
itemsarrayfor groupsNested items in this group
immediatebooleannoFor action type: also press Enter after pasting (default: false)

Action Types

TypeBehaviorExample
groupOpens a submenu with nested itemsNavigate to git commands
actionSends text to the active pane (as if typed). With "immediate": true, also presses Enter.git status
tmuxExecutes a tmux command directlysplit-window -h
scriptRuns a shell script via tmux run-shell~/scripts/my-script.sh
popupOpens command in a temporary display-popup at the pane's working directory. Closes on exit or Escape.lazygit

Example Config

{
  "items": [
    {
      "key": "g",
      "type": "group",
      "description": "git",
      "items": [
        { "key": "s", "type": "action", "command": "git status", "description": "Status", "immediate": true },
        { "key": "c", "type": "action", "command": "git commit", "description": "Commit" },
        { "key": "g", "type": "popup", "command": "lazygit", "description": "Lazygit" }
      ]
    },
    {
      "key": "w",
      "type": "group",
      "description": "window",
      "items": [
        { "key": "v", "type": "tmux", "command": "split-window -h -c '#{pane_current_path}'", "description": "Split vertical" },
        { "key": "s", "type": "tmux", "command": "split-window -v -c '#{pane_current_path}'", "description": "Split horizontal" }
      ]
    },
    { "key": "r", "type": "tmux", "command": "source-file ~/.tmux.conf \\; display-message 'Config reloaded'", "description": "Reload config" },
    { "key": "h", "type": "popup", "command": "htop", "description": "System monitor" },
    { "key": "d", "type": "script", "command": "~/scripts/deploy.sh", "description": "Deploy" }
  ]
}

Default Keybindings

The built-in default config provides ~75 commands organized into 8 groups plus standalone items. Press prefix + Space to open the root menu:

Root Menu

KeyTypeDescription
pgroupPane - split, navigate, zoom, swap, resize, and more
wgroupWindow - create, kill, rename, find, navigate, move
sgroupSession - create, detach, choose, rename, kill, switch
bgroupBuffer - list, paste, choose, save/load, copy mode
lgroupLayout - cycle layouts and select presets
CgroupClient - list, choose, detach, refresh, lock
ogroupOptions - show/set options, environment, messages
ggroupGit - status, diff, log, push, pull, branches, fetch, add, commit, rebase
:tmuxCommand prompt
rtmuxReload tmux config
?tmuxList all keybindings
cactionClear screen
ttmuxClock mode
dtmuxDisplay panes

Pane (p)

KeyDescriptionKeyDescription
vSplit verticalsSplit horizontal
h/j/k/lNavigate paneszZoom toggle
xKill paneoLast pane
!Break to windowJJoin pane
m/MMark/unmark pane{/}Swap up/down
cClear historyqCapture to buffer
pRespawn paner+Resize (subgroup)

Window (w)

KeyDescriptionKeyDescription
nNew windowxKill window
rRenamefFind window
lLast window.Next window
,Previous windowwChoose window
mMove windowsSwap window
RRotate panes

Session (s)

KeyDescriptionKeyDescription
nNew sessiondDetach
sChoose sessionwChoose tree
rRenamekKill session
lList sessionsLLock session
(Previous session)Next session

Buffer (b)

KeyDescriptionKeyDescription
lList bufferspPaste
cChoose bufferdDelete buffer
sSave to fileLLoad from file
vShow bufferyCopy mode
CCapture pane

Layout (l)

KeyDescriptionKeyDescription
nNext layoutpPrevious layout
1Even horizontal2Even vertical
3Main horizontal4Main vertical
5Tiled

Client (C)

KeyDescriptionKeyDescription
lList clientscChoose client
dDetachDDetach other
rRefreshsSuspend
LLock

Options (o)

KeyDescriptionKeyDescription
gShow global optionswShow window options
eShow environmentsSet global option
cCustomize modemShow messages
kList commands

License

MIT