editor

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package editor builds the *exec.Cmd that launches the user's $EDITOR on a given file. It exists as its own package so the CLI (focus edit) and the TUI (e/enter keybind) share the same parsing of $EDITOR — including the multi-token form like "code -w" or "vim -u NONE" that exec.Command can't handle directly.

Index

Constants

View Source
const DefaultEditor = "vi"

DefaultEditor is the fallback when $EDITOR is unset.

Variables

This section is empty.

Functions

func Command

func Command(path string) (*exec.Cmd, error)

Command parses $EDITOR (falling back to DefaultEditor when unset) and returns an *exec.Cmd that runs it on path. $EDITOR is split on whitespace so values like "code -w" are interpreted as binary + args; this matches git's GIT_EDITOR semantics. Use Command.Stdin / Stdout / Stderr to wire I/O before calling Run().

Returns an error if $EDITOR is set but contains only whitespace.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL