Give the Mac hand its keys: Cmd chords, a backspace that comes home, a real Shift+Tab
Summary
- Every editor chord is now bound on Cmd too (
<D-c/x/v/a/s/f/z>, Cmd+Shift+Z redo, Cmd+/, Cmd+Q, Cmd+arrows, Cmd+Backspace, Cmd+V into the REPL). Terminals don't forward Cmd by default; once one does (iTerm2 3.5+ is a single setting, scoped to the kitty protocol), the whole set is live. Every other printable Cmd chord is floored to<Nop>so a forwarded Cmd+W can't type literal<D-w>into the buffer. - Backspace out of the click-anywhere ghost space now snaps the caret to the end of real text on the first press and deletes for real on the next, instead of inching back one invisible column per press.
- Shift+Tab in insert dedents the current line (
i_CTRL-D), instead of falling through to a plain Tab that indented.
Docs & tests
docs/macos-cmd.md: per-terminal setup recipes;tests/keycheck.shprints what a terminal actually sends.- All behaviors measured on a real pty (
tests/mouse_drive.py,tests/suite_config.sh).
π€ Generated with Claude Code
Summary by cubic
Adds mac-style Cmd chords, fixes Backspace in virtual space, and makes insert-mode Shift+Tab dedent. Previously Cmd chords were ignored or leaked "<D-β¦>" text, Backspace stepped through invisible columns, and Shift+Tab indented; now forwarded Cmd chords mirror editor shortcuts, Backspace snaps home then deletes, and Shift+Tab dedents the current line. All other forwarded Cmd chords are floored to no-ops across normal, insert, visual, select, terminal, and command-line modes to prevent stray characters; insert-mode Cmd+C copies the line; Cmd+V also pastes in the REPL; Cmd+Q opens the quit prompt.
- iTerm2 3.5+: set βLeft Command keyβ to Super or map sequences; Cmd+Shift+Z is
[122;10u]. Forwarding is scoped to the kitty protocol so the shell keeps normal Cmd. - Kitty/Ghostty: unbind chords to forward them; Ghostty needs
unbind, notignore. Some mac menu shortcuts may intercept; verify withtests/keycheck.sh(now negotiates the protocol and exits cleanly on signals). - Terminal.app cannot forward Cmd; use the Ctrl set.
Ctrl+EandCtrl+Rremain Ctrl-only by design.
Summary by CodeRabbit
- New Features
- Added macOS Cmd-key shortcuts for navigation, editing, clipboard actions, search, undo/redo, commenting, saving, and quitting.
- Added insert-mode Shift+Tab dedentation.
- Improved Backspace behavior when editing virtual space.
- Documentation
- Added macOS terminal setup instructions for forwarding Cmd shortcuts.
- Expanded keyboard shortcut documentation and troubleshooting guidance.
- Tests
- Added coverage for Cmd shortcuts, dedentation, Backspace behavior, and terminal key diagnostics.
Greptile Summary
This PR adds forwarded macOS Cmd shortcuts and improves insert-mode Backspace and Shift+Tab behavior.
- Adds Cmd equivalents for editing, navigation, clipboard, search, undo/redo, commenting, and quitting.
- Makes Backspace snap from virtual space to real text and maps insert-mode Shift+Tab to dedent.
- Adds terminal setup documentation, a key-forwarding diagnostic, and expanded headless and PTY coverage.
Confidence Score: 5/5
The PR appears safe to merge because no blocking failure remains within the eligible follow-up review scope.
No blocking failure remains.
Important Files Changed
| Filename | Overview |
|---|---|
| nvimrc.lua | Adds Cmd mappings and floors unused Cmd chords while implementing virtual-space Backspace snapping and insert-mode Shift+Tab dedentation. |
| tests/mouse_drive.py | Extends real-PTY coverage for virtual-space and Backspace behavior. |
| tests/suite_config.sh | Adds runtime editing assertions for Cmd shortcuts and insert-mode Shift+Tab. |
| tests/suite_options.sh | Adds mapping-presence and mapping-RHS checks for the new keybindings. |
| tests/keycheck.sh | Adds an interactive terminal diagnostic that enables the keyboard protocol, captures forwarded keys, and restores terminal state. |
| docs/macos-cmd.md | Documents Cmd forwarding behavior and setup for supported macOS terminal emulators. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
U[macOS keyboard input] --> T[Terminal emulator]
T -->|Forwarded CSI-u Super chord| N[Neovim key decoder]
N --> M[Cmd mappings in nvimrc.lua]
M --> E[Editing and navigation actions]
M --> R[REPL paste or quit flow]
B[Backspace in virtual space] --> S[Snap to end of real text]
ST[Shift+Tab in Insert mode] --> D[Dedent current line]
Reviews (3): Last reviewed commit: "Make the signal keys actually leave keyc..." | Re-trigger Greptile
Context used (3)
- Knowledge Base β Neovim configuration and Drill editor contract
- Knowledge Base β Drill mouse interaction and split resizing
- Knowledge Base β Test harness and suites