Documentation
¶
Overview ¶
Package editor centralizes default-editor detection and resolution.
It mirrors the `ide()` shell helper precedence (agy-ide > code > nano) while honoring an explicit `git.editor` config value and the $VISUAL/$EDITOR environment variables. Both the dashboard open logic and the `eng config git-editor` setter consume this package so the available-editor list stays in one place.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // LookPath resolves a CLI binary on PATH. LookPath = execx.LookPath // Stat checks for macOS .app bundles. Stat = os.Stat )
Mockable entry points for tests.
var Potential = []Option{ {Name: "agy-ide (CLI)", Command: "agy-ide", IsApp: false}, {Name: "antigravity-ide (CLI)", Command: "antigravity-ide", IsApp: false}, {Name: "Antigravity IDE", Command: "Antigravity IDE", IsApp: true}, {Name: "Antigravity VS Code", Command: "Antigravity", IsApp: true}, {Name: "Visual Studio Code (CLI)", Command: "code", IsApp: false}, {Name: "Visual Studio Code (App)", Command: "Visual Studio Code", IsApp: true}, {Name: "Cursor (CLI)", Command: "cursor", IsApp: false}, {Name: "Cursor (App)", Command: "Cursor", IsApp: true}, {Name: "Neovim", Command: "nvim", IsApp: false}, {Name: "Vim", Command: "vim", IsApp: false}, {Name: "Nano", Command: "nano", IsApp: false}, {Name: "Emacs", Command: "emacs", IsApp: false}, {Name: "Sublime Text (CLI)", Command: "subl", IsApp: false}, {Name: "Sublime Text (App)", Command: "Sublime Text", IsApp: true}, {Name: "Xcode", Command: "Xcode", IsApp: true}, {Name: "Android Studio", Command: "Android Studio", IsApp: true}, }
Potential lists known editors in `ide()` precedence order.
Functions ¶
func Commands ¶
func Commands() []string
Commands returns the executable command for each available editor.
func DefaultCommand ¶
DefaultCommand resolves the editor command without a target path. Precedence: explicit config > $VISUAL/$EDITOR > agy-ide > code > nano.