pub enum Editor {
Show 19 variants
None,
Helix,
Neovim,
Vim,
Nano,
Micro,
Emacs,
VSCode,
Zed,
Sublime,
RustRover,
IntelliJIdea,
WebStorm,
PyCharm,
GoLand,
CLion,
Fleet,
AndroidStudio,
Custom(String),
}Expand description
Supported editors and IDEs.
Variants§
None
No editor configured.
Helix
Neovim
Vim
Nano
Micro
Emacs
VSCode
Zed
Sublime
RustRover
IntelliJIdea
WebStorm
PyCharm
GoLand
CLion
Fleet
AndroidStudio
Custom(String)
A user-supplied binary name or path.
Implementations§
Source§impl Editor
impl Editor
Sourcepub fn binary(&self) -> Option<String>
pub fn binary(&self) -> Option<String>
Return the launch binary for this editor. Returns None for Editor::None.
Sourcepub fn binary_candidates(&self) -> Vec<String>
pub fn binary_candidates(&self) -> Vec<String>
Return the ordered list of binary names to try when launching this editor.
Most editors have exactly one binary name. Helix has two (helix on
Linux, hx on macOS) so we return both and let the caller try them in
order, stopping at the first one that is found in $PATH.
Sourcepub fn is_terminal_editor(&self) -> bool
pub fn is_terminal_editor(&self) -> bool
Returns true for editors that run inside a terminal (TTY required).
These editors cannot be spawned in the background from a TUI application — the TUI must suspend itself first, run the editor synchronously, then resume.
Sourcepub fn display_name(&self) -> &str
pub fn display_name(&self) -> &str
Display name for the editor.
Sourcepub fn from_index(index: usize) -> Self
pub fn from_index(index: usize) -> Self
Get editor by index into EDITOR_NAMES.
Sourcepub fn open_file(&self, file_path: &Path) -> Result<()>
pub fn open_file(&self, file_path: &Path) -> Result<()>
Open a file in this editor as a background process.
Stdin/stdout/stderr are detached so the caller is not blocked. This is correct for GUI editors (VS Code, Zed, IntelliJ, …).
Do not call this for terminal editors from a running TUI — use the
pending_editor_open mechanism in App instead so the TUI can
suspend itself before handing the terminal to the editor.
On macOS, GUI editors are opened via open -a "App Name" file so the
existing application window is activated and brought to the front.
Sourcepub fn open_file_or_default(&self, file_path: &Path) -> Result<String>
pub fn open_file_or_default(&self, file_path: &Path) -> Result<String>
Open a file in this editor, falling back to the system default opener
(xdg-open / open / start) when no editor is configured or the
configured editor fails to launch.
Always succeeds as long as the system has a default file handler.
Returns the method used: "editor", "system default", or an error.