# pi-set-editor

Choose which external editor pi uses for `Ctrl+G`.

This extension adds a small editor-selection workflow so you can switch editors per session, and optionally save a default.

## Commands

| Command | Description |
|---------|-------------|
| `/set-editor` | Pick an editor for this session only |
| `/set-editor <name>` | Set editor by name for this session only (e.g. `micro`, `nvim`, `zed`) |
| `/set-editor-save` | Pick an editor and save it as your default |
| `/set-editor list` | Show known editors and availability |
| `/set-editor discover` | Show only detected editors on `PATH` |
| `/set-editor find <text>` | Filter editor list |
| `/set-editor current` | Show current `$VISUAL`/`$EDITOR` and saved default |
| `/set-editor add <name> <command...>` | Add/update a custom editor command |
| `/set-editor remove <name>` | Remove a custom editor command |
| `/set-editor reset` | Clear saved default and custom editor list |
| `/editors` | Alias for `/set-editor` |

## Install

```bash
pi install npm:pi-set-editor
```

Or from git:

```bash
pi install https://github.com/omaclaren/pi-set-editor
```

Or run directly:

```bash
pi -e https://github.com/omaclaren/pi-set-editor
```

## Notes

- `/set-editor` is **session-only** (does not persist).
- `/set-editor-save` persists your selection to `~/.pi/agent/set-editor.json`.
- The extension updates `process.env.VISUAL` and `process.env.EDITOR` for the current pi process.
- It does **not** change your global shell/app environment.
- Default known editors include `micro`, `nvim`, `vim`, `zed`, `code`, `cursor`, `windsurf`, and more.

## License

MIT
