# Ghostty keybindings for pi-ghostty-native-editor # https://github.com/k7d/pi-ghostty-native-editor # # Ghostty normally handles these keys itself. Unbinding them makes Ghostty send # them to the program instead, encoded with the Kitty keyboard protocol that pi enables. # # Ghostty defaults that already work with pi are kept, and keep working in the shell: # Cmd+←/→ sends Ctrl+A/E, Option+←/→ sends ESC b/f, Cmd+Backspace sends Ctrl+U, # Cmd+V pastes (bracketed paste replaces the prompt selection). # # Include it from your Ghostty config (the leading ? makes it optional): # config-file = ?/absolute/path/to/ghostty.conf # Undo / redo / select all / cut keybind = super+z=unbind keybind = super+shift+z=unbind keybind = super+a=unbind keybind = super+x=unbind # Copy: copy Ghostty's own selection when there is one, otherwise send Cmd+C to pi # so it copies the prompt selection. keybind = performable:super+c=copy_to_clipboard # Shift+arrows: keep adjusting Ghostty's own selection when there is one, # otherwise send the keys to the program (pi extends the prompt selection). keybind = performable:shift+arrow_left=adjust_selection:left keybind = performable:shift+arrow_right=adjust_selection:right keybind = performable:shift+arrow_up=adjust_selection:up keybind = performable:shift+arrow_down=adjust_selection:down keybind = performable:shift+home=adjust_selection:home keybind = performable:shift+end=adjust_selection:end # Cmd+↑/↓ (start/end of prompt) and Cmd+Shift+↑/↓ (select to start/end). # Ghostty uses these to jump between shell prompts by default. keybind = super+arrow_up=unbind keybind = super+arrow_down=unbind keybind = super+shift+arrow_up=unbind keybind = super+shift+arrow_down=unbind # Optional: let programs see Shift on mouse clicks so Shift+click extends the prompt # selection. Affects all terminal programs that use the mouse. # mouse-shift-capture = true