renamevim

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action int

Action is the editor-level result of handling a key.

const (
	ActionNone Action = iota
	ActionConfirm
	ActionCancel
)

type Mode

type Mode int

Mode is the rename editor modal state.

const (
	ModeNormal Mode = iota
	ModeInsert
	ModeVisual
)

func (Mode) String

func (m Mode) String() string

type Model

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

Model is a Vim-style single-line editor for rename prompts.

Cursor is stored as a caret position [0..len(buf)].

func New

func New(initial string) Model

New creates a rename editor in NORMAL mode initialized with a filename.

func (Model) Mode

func (m Model) Mode() Mode

Mode returns the current editor mode.

func (Model) ModeLabel

func (m Model) ModeLabel() string

ModeLabel returns a user-facing uppercase mode label.

func (Model) Update

func (m Model) Update(msg tea.KeyMsg) (Model, Action)

Update handles one key event and returns the resulting action.

func (Model) Value

func (m Model) Value() string

Value returns the current edited filename.

func (Model) View

func (m Model) View(t theme.Theme) string

View renders the editable filename value with cursor/selection styling.

Jump to

Keyboard shortcuts

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