editors

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Editor

type Editor interface {
	GetEditorExecutable() string
	OpenFile(file string) error
	OpenFileWithCursorAtEnd(file string) error
	OpenFileReadOnly(file string) error
}

Editor contains all the methods required to use a specfic editor.

Note: The editor doesn't need to do exactly what the method implies. For instance, if an editor doesn't support opening a file with the cursor at the end, just open the file normally and manually navigate to the bottom.

func GetEditor

func GetEditor(name string) (Editor, error)

type Nano

type Nano struct{}

Nano editor, for more information see https://www.nano-editor.org/.

func (Nano) GetEditorExecutable

func (nano Nano) GetEditorExecutable() string

func (Nano) OpenFile

func (nano Nano) OpenFile(file string) error

func (Nano) OpenFileReadOnly

func (nano Nano) OpenFileReadOnly(file string) error

func (Nano) OpenFileWithCursorAtEnd

func (nano Nano) OpenFileWithCursorAtEnd(file string) error

type Neovim

type Neovim struct{}

Neovim editor, for more information see https://neovim.io/.

func (Neovim) GetEditorExecutable

func (nvim Neovim) GetEditorExecutable() string

func (Neovim) OpenFile

func (nvim Neovim) OpenFile(file string) error

func (Neovim) OpenFileReadOnly

func (nvim Neovim) OpenFileReadOnly(file string) error

func (Neovim) OpenFileWithCursorAtEnd

func (nvim Neovim) OpenFileWithCursorAtEnd(file string) error

type Vi

type Vi struct{}

Vim editor, for more information see https://www.cs.colostate.edu/helpdocs/vi.html.

func (Vi) GetEditorExecutable

func (vi Vi) GetEditorExecutable() string

func (Vi) OpenFile

func (vi Vi) OpenFile(file string) error

func (Vi) OpenFileReadOnly

func (vi Vi) OpenFileReadOnly(file string) error

func (Vi) OpenFileWithCursorAtEnd

func (vi Vi) OpenFileWithCursorAtEnd(file string) error

type Vim

type Vim struct{}

Vim editor, for more information see https://www.vim.org/.

func (Vim) GetEditorExecutable

func (vim Vim) GetEditorExecutable() string

func (Vim) OpenFile

func (vim Vim) OpenFile(file string) error

func (Vim) OpenFileReadOnly

func (vim Vim) OpenFileReadOnly(file string) error

func (Vim) OpenFileWithCursorAtEnd

func (vim Vim) OpenFileWithCursorAtEnd(file string) error

Jump to

Keyboard shortcuts

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