editor

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenFileCmd

func OpenFileCmd(path string, opts ...CreateEditorCmdOption) *exec.Cmd

OpenFileCmd produces an exec.Cmd to open a path in an editor. It will use the first successful CreateEditorCmdOption. Otherwise it will fallback to "vi".

func OpenFileCmdDefault

func OpenFileCmdDefault(path string, prioritize ...CreateEditorCmdOption) *exec.Cmd

OpenFileCmdDefault produces an exec.Cmd to open a path in an editor. It tries to prioritize the given list of editors before accessing a list of default editors. default editor options with priority: 1. env VISUAL 2. env EDITOR

Types

type Cmd

type Cmd struct {
	// contains filtered or unexported fields
}

func EnvEditor

func EnvEditor() (*Cmd, error)

func EnvVisual

func EnvVisual() (*Cmd, error)

type CreateEditorCmdOption

type CreateEditorCmdOption func() (*Cmd, error)

func WithCmdString

func WithCmdString(fn func() (string, error)) CreateEditorCmdOption

Jump to

Keyboard shortcuts

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