1 +# ── Keybinds for ghostty ──────────────────────────────────────────────────────
2 +# Ports wezterm bugabinga/key_binds.lua using ghostty 1.3 key tables.
4 +# Leader: ctrl+a (VoidSymbol in wezterm, ctrl+a here)
5 +# All modes use catch_all=ignore to prevent key leaks.
7 +# Wipe all defaults (equivalent to wezterm's disable_default_key_bindings)
10 +# ── Clipboard ─────────────────────────────────────────────────────────────────
11 +keybind = ctrl+shift+c=copy_to_clipboard
12 +keybind = ctrl+shift+v=paste_from_clipboard
14 +# ── Font mode ─────────────────────────────────────────────────────────────────
15 +# Port of wezterm font_mode: -=scale down, ==scale up, 0=reset
16 +keybind = ctrl+a>0=activate_key_table:font
17 +keybind = font/-=decrease_font_size:1
18 +keybind = font/==increase_font_size:1
19 +keybind = font/0=reset_font_size
20 +keybind = font/escape=deactivate_key_table
21 +keybind = font/catch_all=ignore
23 +# ── Pane mode ─────────────────────────────────────────────────────────────────
24 +# Port of wezterm pane_mode: hjkl navigate, vs split, a select, q close
25 +keybind = ctrl+a>w=activate_key_table:pane
26 +keybind = pane/h=goto_split:left
27 +keybind = pane/j=goto_split:down
28 +keybind = pane/k=goto_split:up
29 +keybind = pane/l=goto_split:right
30 +keybind = pane/v=new_split:right
31 +keybind = pane/s=new_split:down
32 +keybind = pane/==activate_key_table:resize
33 +keybind = pane/q=close_surface
34 +keybind = pane/escape=deactivate_key_table
35 +keybind = pane/catch_all=ignore
37 +# ── Resize sub-mode ──────────────────────────────────────────────────────────
38 +# Port of wezterm resize_pane_mode: hjkl resize by 10px
39 +keybind = resize/h=resize_split:left,10
40 +keybind = resize/j=resize_split:down,10
41 +keybind = resize/k=resize_split:up,10
42 +keybind = resize/l=resize_split:right,10
43 +keybind = resize/escape=deactivate_key_table
44 +keybind = resize/catch_all=ignore
46 +# ── Direct leader sequences ───────────────────────────────────────────────────
47 +# Single-shot actions that don't need a mode
48 +keybind = ctrl+a>f=toggle_split_zoom
49 +keybind = ctrl+a>F5=reload_config
50 +keybind = ctrl+a>F11=toggle_fullscreen
51 +keybind = ctrl+a>t=new_tab
52 +keybind = ctrl+a>/=start_search
53 +keybind = ctrl+a>q=close_surface
55 +# ── Tab navigation (leader + number) ─────────────────────────────────────────
56 +keybind = ctrl+a>1=goto_tab:1
57 +keybind = ctrl+a>2=goto_tab:2
58 +keybind = ctrl+a>3=goto_tab:3
59 +keybind = ctrl+a>4=goto_tab:4
60 +keybind = ctrl+a>5=goto_tab:5
61 +keybind = ctrl+a>6=goto_tab:6
62 +keybind = ctrl+a>7=goto_tab:7
63 +keybind = ctrl+a>8=goto_tab:8
65 +# ── Scrolling ─────────────────────────────────────────────────────────────────
66 +keybind = page_up=scroll_page_up
67 +keybind = page_down=scroll_page_down
68 +keybind = shift+page_up=scroll_page_fractional:-0.42
69 +keybind = shift+page_down=scroll_page_fractional:0.42
71 +# ── Command palette (replaces wezterm launcher) ───────────────────────────────
72 +keybind = ctrl+a>p=toggle_command_palette