tui

package
v0.0.0-...-2f4f41e Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultInsertKeyMap, _ = buildInsertKmapFromConfig(mergeKeys(DefaultKeyMapConfig["Shared"], DefaultKeyMapConfig["Insert"]))
View Source
var DefaultKeyMap = KeyMap{
	Normal: DefaultNormalKeyMap,
	Insert: DefaultInsertKeyMap,
	Visual: DefaultVisualKeyMap,
}
View Source
var DefaultKeyMapConfig = map[string]map[string]string{
	"Shared": {
		"Up":               "k",
		"UpFive":           "K",
		"Down":             "j",
		"DownFive":         "J",
		"QuitNoWarning":    "ctrl+c",
		"Yank":             "y",
		"ToggleCompletion": " ",
		"JumpUp":           "{",
		"JumpDown":         "}",
	},
	"Normal": {
		"QuitWithWarning":  "q",
		"NewTask":          "n",
		"NewBefore":        "O",
		"NewAfter":         "o",
		"EditTask":         "i",
		"ClearAndEdit":     "x",
		"DeleteTask":       "d",
		"EnableVisualMode": "v",
		"PasteAfter":       "p",
		"PasteBefore":      "P",
		"Write":            "w",
	},
	"Insert": {
		"Discard": "esc",
		"Save":    "enter",
	},
	"Visual": {
		"NormalMode": "esc",
		"Delete":     "d",
	},
}
View Source
var DefaultNormalKeyMap, _ = buildNormalKmapFromConfig(mergeKeys(DefaultKeyMapConfig["Shared"], DefaultKeyMapConfig["Normal"]))
View Source
var DefaultVisualKeyMap, _ = buildVisualKmapFromConfig(mergeKeys(DefaultKeyMapConfig["Shared"], DefaultKeyMapConfig["Visual"]))

Functions

func NewModel

func NewModel(list core.List, kmap KeyMap) (model, error)

Initialize a new model to edit the list with the given name.

Types

type InsertKeyMap

type InsertKeyMap struct {
	Discard       key.Binding
	QuitNoWarning key.Binding
	Save          key.Binding
}

func (InsertKeyMap) FullHelp

func (k InsertKeyMap) FullHelp() [][]key.Binding

FullHelp returns keybindings for the expanded help view. It's part of the key.Map interface.

func (InsertKeyMap) ShortHelp

func (k InsertKeyMap) ShortHelp() []key.Binding

ShortHelp returns keybindings to be shown in the mini help view. It's part of the key.Map interface.

type KeyMap

type KeyMap struct {
	Normal NormalKeyMap
	Insert InsertKeyMap
	Visual VisualKeyMap
}

func LoadKmap

func LoadKmap(pth string) (KeyMap, error)

type NormalKeyMap

type NormalKeyMap struct {
	Up               key.Binding
	UpFive           key.Binding
	Down             key.Binding
	DownFive         key.Binding
	QuitWithWarning  key.Binding
	QuitNoWarning    key.Binding
	NewTask          key.Binding
	NewBefore        key.Binding
	NewAfter         key.Binding
	EditTask         key.Binding
	ClearAndEdit     key.Binding
	DeleteTask       key.Binding
	ToggleCompletion key.Binding
	EnableVisualMode key.Binding
	Yank             key.Binding
	PasteAfter       key.Binding
	PasteBefore      key.Binding
	Write            key.Binding
	JumpUp           key.Binding
	JumpDown         key.Binding
}

func (NormalKeyMap) FullHelp

func (k NormalKeyMap) FullHelp() [][]key.Binding

FullHelp returns keybindings for the expanded help view. It's part of the key.Map interface.

func (NormalKeyMap) ShortHelp

func (k NormalKeyMap) ShortHelp() []key.Binding

ShortHelp returns keybindings to be shown in the mini help view. It's part of the key.Map interface.

type VisualKeyMap

type VisualKeyMap struct {
	Up               key.Binding
	Down             key.Binding
	UpFive           key.Binding
	DownFive         key.Binding
	NormalMode       key.Binding
	QuitNoWarning    key.Binding
	Delete           key.Binding
	Yank             key.Binding
	ToggleCompletion key.Binding
	JumpUp           key.Binding
	JumpDown         key.Binding
}

func (VisualKeyMap) FullHelp

func (k VisualKeyMap) FullHelp() [][]key.Binding

FullHelp returns keybindings for the expanded help view. It's part of the key.Map interface.

func (VisualKeyMap) ShortHelp

func (k VisualKeyMap) ShortHelp() []key.Binding

ShortHelp returns keybindings to be shown in the mini help view. It's part of the key.Map interface.

Jump to

Keyboard shortcuts

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