nvim

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

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

Model is the Bubble Tea model for the Neovim component. This is a reusable component that can be embedded in any TUI application.

func New

func New(opts Options) (Model, error)

New creates and initializes a new Neovim component.

func (*Model) Close

func (m *Model) Close() error

Close closes the Neovim process.

func (Model) CursorPosition

func (m Model) CursorPosition() (int, int)

CursorPosition returns the current cursor row and column.

func (Model) FormatMode

func (m Model) FormatMode() string

FormatMode returns a human-readable representation of the current mode.

func (Model) Init

func (m Model) Init() tea.Cmd

Init implements tea.Model. It starts listening for redraw events.

func (Model) Mode

func (m Model) Mode() string

Mode returns the current Neovim mode (normal, insert, visual, etc.)

func (*Model) OpenFile

func (m *Model) OpenFile(filepath string)

OpenFile opens a file in the Neovim instance.

func (*Model) Save

func (m *Model) Save() error

Save saves the current buffer and waits for completion.

func (*Model) SetFocused

func (m *Model) SetFocused(focused bool)

SetFocused sets whether this component has focus (for cursor rendering).

func (*Model) SetSize

func (m *Model) SetSize(width, height int) tea.Cmd

SetSize updates the size of the Neovim component.

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model. It handles key messages and redraw events.

func (Model) View

func (m Model) View() string

View implements tea.Model. It renders the Neovim grid.

type Options

type Options struct {
	Width      int    // Initial width of the Neovim grid
	Height     int    // Initial height of the Neovim grid
	FileToOpen string // Optional path to a file to open on startup
	UseConfig  bool   // If true, loads the user's default Neovim config
}

Options holds configuration for creating a new Neovim component.

Jump to

Keyboard shortcuts

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