Rewrites functions/edit.fish (previously a thin nvim wrapper) into a flexible launcher that picks a GUI or terminal editor, resolves rich fallback chains, and can open the clipboard or a literal string as throwaway files. Drives both interactive CLI use (edit notes.txt, abbreviated e) and desktop shortcuts (edit --clipboard --visual).
Behavior
Mode:--visual/--terminal force GUI/terminal; with neither, mode auto-detects — interactive tty → terminal ($EDITOR), detached (e.g. .desktop launch) → GUI ($VISUAL).
Terminal fallback chain:nvim → vim → micro → nano → vi
--editor=X overrides resolution with a specific binary.
--clipboard reuses the existing p function (p > tmpfile); --text=STR writes a literal string to a temp file. Both are additive with positional files.
--new maps to per-editor new-window flags (kate/kwrite --new, code/codium/zed -n, gnome-text-editor --new-window); ignored where unsupported (best-effort).
--verbose prints the launch command and lets editor output through; --silent suppresses everything. The two, and --visual/--terminal, are mutually exclusive (clear errors).
GUI editors launch detached (&; disown, output to /dev/null); terminal editors run in the foreground.
Opinionated guard (C1)
Gated in-body via __fish_config_op_enabled __fish_config_op_aliases (live toggle). When C1 is disabled it falls back to the legacy bare-editor behavior ($EDITOR → nvim → nano → vi), so it stays a drop-in for the old edit.
Docs
docs/fish-config.md: rewrote the edit function entry and added an edit row to the C1 Component Reference table.
Generated outputs (docs/fish-config.1, docs/html/, docs/wiki/) regenerate via the Gitea Actions man-page/docs workflow on merge to main.
Notes
Clipboard/text temp files are left for the OS to reap from /tmp — GUI editors are detached, so they can't be safely removed mid-edit.
No edt alias added: the existing abbr -a e edit already provides a short name and now points at the new launcher.
Manual Verification
edit notes.txt in an interactive terminal opens it in the terminal editor ($EDITOR/nvim).
edit --visual notes.txt opens it in the GUI editor (kate/zed/etc.).
edit --editor=code README.md opens in VS Code specifically.
edit --clipboard opens current clipboard contents as a temp file.
edit --text="hello world" opens a temp file containing hello world.
edit --terminal --new todo.md opens a new window/instance where supported.
edit --visual --terminal and edit -v -s each error out with a clear message and exit 1.
edit -e nonexistent-binary file errors with "editor not found" and exit 1.
edit -h shows colored help on stdout.
With set -U __fish_config_op_aliases off, edit file falls back to the bare editor (no GUI/clipboard frills); re-enabling restores the launcher live.
## Summary
Rewrites `functions/edit.fish` (previously a thin nvim wrapper) into a flexible launcher that picks a **GUI or terminal** editor, resolves rich fallback chains, and can open the clipboard or a literal string as throwaway files. Drives both interactive CLI use (`edit notes.txt`, abbreviated `e`) and desktop shortcuts (`edit --clipboard --visual`).
## Behavior
- **Mode:** `--visual`/`--terminal` force GUI/terminal; with neither, mode auto-detects — interactive tty → terminal (`$EDITOR`), detached (e.g. `.desktop` launch) → GUI (`$VISUAL`).
- **GUI fallback chain:** `zed → antigravity-ide → code → kate → kwrite → gnome-text-editor → gedit`
- **Terminal fallback chain:** `nvim → vim → micro → nano → vi`
- `--editor=X` overrides resolution with a specific binary.
- `--clipboard` reuses the existing `p` function (`p > tmpfile`); `--text=STR` writes a literal string to a temp file. Both are additive with positional files.
- `--new` maps to per-editor new-window flags (kate/kwrite `--new`, code/codium/zed `-n`, gnome-text-editor `--new-window`); ignored where unsupported (best-effort).
- `--verbose` prints the launch command and lets editor output through; `--silent` suppresses everything. The two, and `--visual`/`--terminal`, are mutually exclusive (clear errors).
- GUI editors launch detached (`&; disown`, output to `/dev/null`); terminal editors run in the foreground.
## Opinionated guard (C1)
Gated in-body via `__fish_config_op_enabled __fish_config_op_aliases` (live toggle). When C1 is disabled it falls back to the legacy bare-editor behavior (`$EDITOR` → nvim → nano → vi), so it stays a drop-in for the old `edit`.
## Docs
- `docs/fish-config.md`: rewrote the `edit` function entry and added an `edit` row to the C1 Component Reference table.
- `README.md` + AGENTS C1 shadow list: added `edit`→multi-editor launcher.
- Generated outputs (`docs/fish-config.1`, `docs/html/`, `docs/wiki/`) regenerate via the Gitea Actions man-page/docs workflow on merge to `main`.
## Notes
- Clipboard/text temp files are left for the OS to reap from `/tmp` — GUI editors are detached, so they can't be safely removed mid-edit.
- No `edt` alias added: the existing `abbr -a e edit` already provides a short name and now points at the new launcher.
## Manual Verification
- [x] `edit notes.txt` in an interactive terminal opens it in the terminal editor (`$EDITOR`/nvim).
- [x] `edit --visual notes.txt` opens it in the GUI editor (kate/zed/etc.).
- [x] `edit --editor=code README.md` opens in VS Code specifically.
- [x] `edit --clipboard` opens current clipboard contents as a temp file.
- [x] `edit --text="hello world"` opens a temp file containing `hello world`.
- [x] `edit --terminal --new todo.md` opens a new window/instance where supported.
- [x] `edit --visual --terminal` and `edit -v -s` each error out with a clear message and exit 1.
- [x] `edit -e nonexistent-binary file` errors with "editor not found" and exit 1.
- [x] `edit -h` shows colored help on stdout.
- [x] With `set -U __fish_config_op_aliases off`, `edit file` falls back to the bare editor (no GUI/clipboard frills); re-enabling restores the launcher live.
VISUAL was hardwired to $EDITOR (nvim), so 'edit --visual' would launch a
terminal editor detached with no tty. Comment it out so --visual falls
through to the GUI fallback chain, and let users set a real GUI editor via
local.fish. Update the editor-variable docs to match.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Rewrites
functions/edit.fish(previously a thin nvim wrapper) into a flexible launcher that picks a GUI or terminal editor, resolves rich fallback chains, and can open the clipboard or a literal string as throwaway files. Drives both interactive CLI use (edit notes.txt, abbreviatede) and desktop shortcuts (edit --clipboard --visual).Behavior
--visual/--terminalforce GUI/terminal; with neither, mode auto-detects — interactive tty → terminal ($EDITOR), detached (e.g..desktoplaunch) → GUI ($VISUAL).zed → antigravity-ide → code → kate → kwrite → gnome-text-editor → geditnvim → vim → micro → nano → vi--editor=Xoverrides resolution with a specific binary.--clipboardreuses the existingpfunction (p > tmpfile);--text=STRwrites a literal string to a temp file. Both are additive with positional files.--newmaps to per-editor new-window flags (kate/kwrite--new, code/codium/zed-n, gnome-text-editor--new-window); ignored where unsupported (best-effort).--verboseprints the launch command and lets editor output through;--silentsuppresses everything. The two, and--visual/--terminal, are mutually exclusive (clear errors).&; disown, output to/dev/null); terminal editors run in the foreground.Opinionated guard (C1)
Gated in-body via
__fish_config_op_enabled __fish_config_op_aliases(live toggle). When C1 is disabled it falls back to the legacy bare-editor behavior ($EDITOR→ nvim → nano → vi), so it stays a drop-in for the oldedit.Docs
docs/fish-config.md: rewrote theeditfunction entry and added aneditrow to the C1 Component Reference table.README.md+ AGENTS C1 shadow list: addededit→multi-editor launcher.docs/fish-config.1,docs/html/,docs/wiki/) regenerate via the Gitea Actions man-page/docs workflow on merge tomain.Notes
/tmp— GUI editors are detached, so they can't be safely removed mid-edit.edtalias added: the existingabbr -a e editalready provides a short name and now points at the new launcher.Manual Verification
edit notes.txtin an interactive terminal opens it in the terminal editor ($EDITOR/nvim).edit --visual notes.txtopens it in the GUI editor (kate/zed/etc.).edit --editor=code README.mdopens in VS Code specifically.edit --clipboardopens current clipboard contents as a temp file.edit --text="hello world"opens a temp file containinghello world.edit --terminal --new todo.mdopens a new window/instance where supported.edit --visual --terminalandedit -v -seach error out with a clear message and exit 1.edit -e nonexistent-binary fileerrors with "editor not found" and exit 1.edit -hshows colored help on stdout.set -U __fish_config_op_aliases off,edit filefalls back to the bare editor (no GUI/clipboard frills); re-enabling restores the launcher live.