keys

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Common = common{
	Plan: key.NewBinding(
		key.WithKeys("p"),
		key.WithHelp("p", "plan"),
	),
	Apply: key.NewBinding(
		key.WithKeys("a"),
		key.WithHelp("a", "apply"),
	),
	Cancel: key.NewBinding(
		key.WithKeys("c"),
		key.WithHelp("c", "cancel"),
	),
	Delete: key.NewBinding(
		key.WithKeys("d"),
		key.WithHelp("d", "delete"),
	),
	ShowState: key.NewBinding(
		key.WithKeys("s"),
		key.WithHelp("s", "show state"),
	),
	Retry: key.NewBinding(
		key.WithKeys("r"),
		key.WithHelp("r", "retry"),
	),
	Reload: key.NewBinding(
		key.WithKeys("ctrl+r"),
		key.WithHelp("ctrl+r", "reload"),
	),
	Module: key.NewBinding(
		key.WithKeys("m"),
		key.WithHelp("m", "module"),
	),
	Workspace: key.NewBinding(
		key.WithKeys("w"),
		key.WithHelp("w", "workspace"),
	),
}

Keys shared by several models.

View Source
var Global = global{
	Modules: key.NewBinding(
		key.WithKeys("M"),
		key.WithHelp("M", "all modules"),
	),
	Workspaces: key.NewBinding(
		key.WithKeys("W"),
		key.WithHelp("W", "all workspaces"),
	),
	Runs: key.NewBinding(
		key.WithKeys("R"),
		key.WithHelp("R", "all runs"),
	),
	Tasks: key.NewBinding(
		key.WithKeys("T"),
		key.WithHelp("T", "all tasks"),
	),
	Logs: key.NewBinding(
		key.WithKeys("l"),
		key.WithHelp("l", "logs"),
	),
	Escape: key.NewBinding(
		key.WithKeys("esc", "`"),
		key.WithHelp("esc,`", "back"),
	),
	Enter: key.NewBinding(
		key.WithKeys("enter"),
		key.WithHelp("enter", "view"),
	),
	Select: key.NewBinding(
		key.WithKeys("s", " "),
		key.WithHelp("<space>,s", "select"),
	),
	SelectAll: key.NewBinding(
		key.WithKeys("ctrl+a"),
		key.WithHelp("ctrl+a", "select all"),
	),
	Quit: key.NewBinding(
		key.WithKeys("ctrl+c"),
		key.WithHelp("^c", "exit"),
	),
	Help: key.NewBinding(
		key.WithKeys("?"),
		key.WithHelp("?", "help"),
	),
}
View Source
var Navigation = navigation{
	LineUp: key.NewBinding(
		key.WithKeys("up", "k"),
		key.WithHelp("↑/k", "up"),
	),
	LineDown: key.NewBinding(
		key.WithKeys("down", "j"),
		key.WithHelp("↓/j", "down"),
	),
	PageUp: key.NewBinding(
		key.WithKeys("b", "pgup"),
		key.WithHelp("b/pgup", "page up"),
	),
	PageDown: key.NewBinding(
		key.WithKeys("f", "pgdown"),
		key.WithHelp("f/pgdn", "page down"),
	),
	HalfPageUp: key.NewBinding(
		key.WithKeys("u", "ctrl+u"),
		key.WithHelp("u", "½ page up"),
	),
	HalfPageDown: key.NewBinding(
		key.WithKeys("d", "ctrl+d"),
		key.WithHelp("d", "½ page down"),
	),
	GotoTop: key.NewBinding(
		key.WithKeys("home", "g"),
		key.WithHelp("g/home", "go to start"),
	),
	GotoBottom: key.NewBinding(
		key.WithKeys("end", "G"),
		key.WithHelp("G/end", "go to end"),
	),
	TabNext: key.NewBinding(
		key.WithKeys("tab", "ctrl+pgdown"),
		key.WithHelp("tab/^pgdn", "next tab"),
	),
	TabLast: key.NewBinding(
		key.WithKeys("ctrl+pgup"),
		key.WithHelp("^pgup", "last tab"),
	),
}

Navigation returns key bindings for navigation.

Functions

func KeyMapToSlice

func KeyMapToSlice(t any) (bindings []key.Binding)

KeyMapToSlice takes a struct of fields of type key.Binding and returns it as a slice instead.

Types

This section is empty.

Jump to

Keyboard shortcuts

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