Skip to content

Instantly share code, notes, and snippets.

@venables
Last active July 23, 2026 11:33
Show Gist options
  • Select an option

  • Save venables/1b634058f9f4eafe1327d73930a3d3cd to your computer and use it in GitHub Desktop.

Select an option

Save venables/1b634058f9f4eafe1327d73930a3d3cd to your computer and use it in GitHub Desktop.
Herdr + Ghostty native keybindings (2 config files)

Herdr + Ghostty native-shortcut keybindings

Two files that give Herdr macOS-native keyboard shortcuts inside Ghostty.

  • ghostty/config — maps native chords (cmd+t, cmd+w, cmd+d, cmd+opt+hjkl, etc.) to the escape / CSI-u sequences Herdr listens for. Merge these into your ~/.config/ghostty/config.
  • herdr/config.toml — Herdr's own keymap. Only the overrides to Herdr defaults live here; anything omitted uses the default the ghostty chords already target. Goes at ~/.config/herdr/config.toml.

The prefix is ctrl+b (Herdr hardcodes \x02).

# Ghostty <-> Herdr native macOS keybindings
# Maps native chords to the escape / CSI-u sequences Herdr listens for.
# Prefix is ctrl+b (\x02), which Herdr hardcodes.
# macos/chrome-style herdr actions
keybind = cmd+KeyT=text:\x02t
keybind = cmd+t=unbind
keybind = cmd+KeyN=text:\x02n
keybind = cmd+n=unbind
# cmd+w closes the focused pane (herdr auto-closes the tab on the last pane);
# cmd+shift+w force-closes the whole tab and all its panes
keybind = cmd+KeyW=text:\x02x
keybind = cmd+w=unbind
keybind = cmd+shift+KeyW=text:\x02W
keybind = cmd+shift+w=unbind
keybind = alt+t=text:\x02t
# rename: cmd+r -> rename tab, cmd+shift+r -> rename workspace
keybind = cmd+KeyR=text:\x02T
keybind = cmd+r=unbind
keybind = cmd+shift+KeyR=text:\x02N
keybind = cmd+shift+r=unbind
# cmd+k -> clear screen (ctrl+l to the focused shell)
keybind = cmd+KeyK=text:\x0c
keybind = cmd+k=unbind
# pane navigation: cmd+opt+arrows and cmd+opt+hjkl (nvim-style)
keybind = cmd+alt+left=text:\x02h
keybind = cmd+alt+down=text:\x02j
keybind = cmd+alt+up=text:\x02k
keybind = cmd+alt+right=text:\x02l
keybind = cmd+alt+KeyH=text:\x02h
keybind = cmd+alt+KeyJ=text:\x02j
keybind = cmd+alt+KeyK=text:\x02k
keybind = cmd+alt+KeyL=text:\x02l
# splits: cmd+d vertical (side by side), cmd+shift+d horizontal
keybind = cmd+KeyD=text:\x02v
keybind = cmd+d=unbind
keybind = cmd+shift+KeyD=text:\x02-
keybind = cmd+shift+d=unbind
# zoom active pane: cmd+shift+enter
keybind = cmd+shift+enter=text:\x02z
# pane cycling: cmd+[ prev, cmd+] next
keybind = cmd+left_bracket=text:\x02i
keybind = cmd+right_bracket=text:\x02u
# tab cycling: cmd+shift+[ prev, cmd+shift+] next
keybind = cmd+shift+left_bracket=text:\x1b[9;8u
keybind = cmd+shift+right_bracket=text:\x1b[9;7u
# ctrl+tab / ctrl+shift+tab -> herdr workspaces
keybind = ctrl+tab=text:\x1b[9;5u
keybind = ctrl+shift+tab=text:\x1b[9;6u
# ctrl+alt+tab / ctrl+alt+shift+tab -> herdr tabs
keybind = ctrl+alt+tab=text:\x1b[9;7u
keybind = ctrl+alt+shift+tab=text:\x1b[9;8u
# cmd+1..9 -> herdr workspaces
keybind = cmd+digit_1=text:\x1b[49;6u
keybind = cmd+1=text:\x1b[49;6u
keybind = cmd+digit_2=text:\x1b[50;6u
keybind = cmd+2=text:\x1b[50;6u
keybind = cmd+digit_3=text:\x1b[51;6u
keybind = cmd+3=text:\x1b[51;6u
keybind = cmd+digit_4=text:\x1b[52;6u
keybind = cmd+4=text:\x1b[52;6u
keybind = cmd+digit_5=text:\x1b[53;6u
keybind = cmd+5=text:\x1b[53;6u
keybind = cmd+digit_6=text:\x1b[54;6u
keybind = cmd+6=text:\x1b[54;6u
keybind = cmd+digit_7=text:\x1b[55;6u
keybind = cmd+7=text:\x1b[55;6u
keybind = cmd+digit_8=text:\x1b[56;6u
keybind = cmd+8=text:\x1b[56;6u
keybind = cmd+digit_9=text:\x1b[57;6u
keybind = cmd+9=text:\x1b[57;6u
# Only overrides live here. Anything omitted uses herdr's default, which the
# ghostty chords already target: focus_pane_h/j/k/l, split v/minus, zoom z,
# close_pane x, rename_tab shift+t, close_workspace shift+d.
[keys]
# pinned on purpose: ghostty hardcodes \x02 (ctrl+b), and herdr has changed
# this default before (ctrl+s -> ctrl+b)
prefix = "ctrl+b"
# remapped for macos muscle memory (herdr default noted)
new_tab = "prefix+t" # default prefix+c
new_workspace = "prefix+n" # default prefix+shift+n
close_tab = "prefix+shift+w" # default prefix+shift+x
rename_workspace = "prefix+shift+n" # default prefix+shift+w
cycle_pane_previous = "prefix+i" # default prefix+shift+tab
cycle_pane_next = "prefix+u" # default prefix+tab
# direct chords, driven by ghostty CSI-u sequences
next_workspace = "ctrl+tab" # no herdr default
previous_workspace = "ctrl+shift+tab" # no herdr default
next_tab = "ctrl+alt+tab" # default prefix+n
previous_tab = "ctrl+alt+shift+tab" # default prefix+p
[keys.indexed]
workspaces = "ctrl+shift"
tabs = "alt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment