pi-visual-line-nav
v0.1.0
Published
Visual-line-aware Home/End navigation + prompt stash for pi — repeated presses step through wrapped lines like Claude Code
Maintainers
Readme
pi-visual-line-nav
Visual-line-aware Home/End navigation + prompt stash for Pi.
Install
pi install npm:pi-visual-line-navFeatures
Home / End — visual line navigation
Repeated Home presses step through wrapped visual lines, not logical lines:
- Mid-line → start of current visual line
- Already at start → start of previous visual line
- Already at start of that → start of the one before it
- …
End mirrors this in the opposite direction.
This matches the behaviour of Claude Code and most modern editors.
Ctrl+S — prompt stash
Start typing a prompt, realise you need to ask something else first?
- Ctrl+S — stashes your current input and clears the editor
- Type and submit your other prompt
- The stashed text is automatically restored to the input
Stackable — stash multiple prompts if you keep interrupting yourself.
How it works
The extension overrides Pi's CustomEditor and intercepts the
tui.editor.cursorLineStart / tui.editor.cursorLineEnd keybindings
before the base Editor handles them (which always jumps to logical line
boundaries). It uses Pi's private visual-line-map APIs to calculate
wrapped-line positions.
Configuration
The extension provides behaviour, not key assignments. Your existing
~/.pi/agent/keybindings.json bindings for cursorLineStart and
cursorLineEnd (default: Home / Ctrl+A and End / Ctrl+E) continue to
work.
Ctrl+S is hardcoded in the extension (there's no Pi keybinding ID for it).
License
Unlicense / CC0 — public domain.
