MCPcopy Create free account
hub / github.com/charmbracelet/bubbles / DefaultKeyMap

Function DefaultKeyMap

table/table.go:67–102  ·  view source on GitHub ↗

DefaultKeyMap returns a default set of keybindings.

()

Source from the content-addressed store, hash-verified

65
66// DefaultKeyMap returns a default set of keybindings.
67func DefaultKeyMap() KeyMap {
68 return KeyMap{
69 LineUp: key.NewBinding(
70 key.WithKeys("up", "k"),
71 key.WithHelp("↑/k", "up"),
72 ),
73 LineDown: key.NewBinding(
74 key.WithKeys("down", "j"),
75 key.WithHelp("↓/j", "down"),
76 ),
77 PageUp: key.NewBinding(
78 key.WithKeys("b", "pgup"),
79 key.WithHelp("b/pgup", "page up"),
80 ),
81 PageDown: key.NewBinding(
82 key.WithKeys("f", "pgdown", "space"),
83 key.WithHelp("f/pgdn", "page down"),
84 ),
85 HalfPageUp: key.NewBinding(
86 key.WithKeys("u", "ctrl+u"),
87 key.WithHelp("u", "½ page up"),
88 ),
89 HalfPageDown: key.NewBinding(
90 key.WithKeys("d", "ctrl+d"),
91 key.WithHelp("d", "½ page down"),
92 ),
93 GotoTop: key.NewBinding(
94 key.WithKeys("home", "g"),
95 key.WithHelp("g/home", "go to start"),
96 ),
97 GotoBottom: key.NewBinding(
98 key.WithKeys("end", "G"),
99 key.WithHelp("G/end", "go to end"),
100 ),
101 }
102}
103
104// Styles contains style definitions for this list component. By default, these
105// values are generated by DefaultStyles.

Callers 2

TestNewFunction · 0.70
NewFunction · 0.70

Calls 3

NewBindingFunction · 0.92
WithKeysFunction · 0.92
WithHelpFunction · 0.92

Tested by 1

TestNewFunction · 0.56