keymap

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package keymap provides global key bindings and helpers for building keymaps.

Index

Constants

This section is empty.

Variables

View Source
var (
	Quit = key.NewBinding(
		key.WithKeys("ctrl+c"),
		key.WithHelp("ctrl+c", "quit"),
	)
	Exit = key.NewBinding(
		key.WithKeys("esc"),
		key.WithHelp("", ""),
	)
	Tab = key.NewBinding(
		key.WithKeys("tab"),
		key.WithHelp("tab", "switch focus"),
	)
	Send = key.NewBinding(
		key.WithKeys("enter"),
		key.WithHelp("enter", "send"),
	)
	Newline = key.NewBinding(
		key.WithKeys("shift+enter", "alt+enter", "ctrl+j"),
		key.WithHelp("shift+enter", "newline"),
	)
	Details = key.NewBinding(
		key.WithKeys("ctrl+d"),
		key.WithHelp("ctrl+d", "details"),
	)
	Palette = key.NewBinding(
		key.WithKeys("/"),
		key.WithHelp("/", "commands"),
	)
	// Drawer bindings (shown when the statusbar drawer is open).
	NextTab = key.NewBinding(
		key.WithKeys("tab"),
		key.WithHelp("tab", "next tab"),
	)
	CloseDrawer = key.NewBinding(
		key.WithKeys("esc"),
		key.WithHelp("esc", "close"),
	)

	// Global is shown in the keybar across all screens.
	Global = []key.Binding{Quit}
)

Common key bindings.

Functions

This section is empty.

Types

type Simple

type Simple struct {
	Keys []key.Binding
}

Simple implements help.KeyMap with a basic list of key bindings. Use this when you need to return dynamic keymaps from Help() methods.

func (Simple) FullHelp

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

FullHelp returns the key bindings for the full help view.

func (Simple) ShortHelp

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

ShortHelp returns the key bindings for the short help view.

Jump to

Keyboard shortcuts

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