@leo-alvarenga/pi-qol0.1.1
Small quality-of-life features for pi, individually toggleable
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
pi-qol
Small quality-of-life features for pi, individually toggleable via a single config file.
Install
pi install npm:@leo-alvarenga/pi-qol
# or from this repo:
pi -e ./packages/pi-qol
Config
All features are enabled by default. Disable any feature in ~/.pi/agent/pi-qol.json (file is optional):
{
"external-editor-cwd": { "disabled": true },
}
Run /reload after editing any config.
Feature: external-editor-cwd
Edit the current prompt in your external editor. The file is written to the current working directory so your editor can pick up project context (.editorconfig, LSP, etc.).
Default key: ctrl+shift+e (Can be set to override the default "Open in Editor" keybinding)
Choosing the key
{ "external-editor-cwd": { "keybinding": "native" } } // take over pi's ctrl+g
{ "external-editor-cwd": { "keybinding": "ctrl+shift+e" } } // default
{ "external-editor-cwd": { "keybinding": "alt+e" } } // any valid key id
Any invalid value is reported at session start and the extension falls back to ctrl+shift+e.
"native" mode
pi's built-in editor shortcut (ctrl+g) is in a reserved list that prevents extensions from claiming it while it is active. Setting keybinding: "native" writes "app.editor.external": [] into ~/.pi/agent/keybindings.json to release that binding, then prompts you to run /reload once. After that single reload, ctrl+g opens this extension's editor instead.
- The file reformat is intentional: pi rejects comments in
keybindings.jsonanyway - Reverting: remove the
[]entry and switchkeybindingaway from"native"
Editor selection
Follows pi's own order: settings.json:externalEditor → $VISUAL → $EDITOR → nano (notepad on Windows).
Behaviour
- The current prompt is written to
./prompt.md(or./prompt-<id>.mdif the file already exists) in the working directory - The TUI suspends and hands the terminal to the editor
- Exit 0: the file is read back into the prompt editor and deleted
- Non-zero exit or spawn failure: the file is kept and its path is shown in a warning; your text is safe
- Unwritable cwd: the file is written to the OS temp dir instead
super+bindings require a terminal with Kitty keyboard protocol support- The shortcut requires the prompt editor to have focus. Extensions that replace the editor component must forward
onExtensionShortcutfor this to work