4 "charm.land/bubbles/v2/key"
7// KeyMap defines the keyboard bindings for the quit dialog.
17func DefaultKeymap() KeyMap {
19 LeftRight: key.NewBinding(
20 key.WithKeys("left", "right"),
21 key.WithHelp("←/→", "switch options"),
23 EnterSpace: key.NewBinding(
24 key.WithKeys("enter", " "),
25 key.WithHelp("enter/space", "confirm"),
28 key.WithKeys("y", "Y", "ctrl+c"),
29 key.WithHelp("y/Y/ctrl+c", "yes"),
32 key.WithKeys("n", "N"),
33 key.WithHelp("n/N", "no"),
37 key.WithHelp("tab", "switch options"),
39 Close: key.NewBinding(
40 key.WithKeys("esc", "alt+esc"),
41 key.WithHelp("esc", "cancel"),
46// KeyBindings implements layout.KeyMapProvider
47func (k KeyMap) KeyBindings() []key.Binding {
58// FullHelp implements help.KeyMap.
59func (k KeyMap) FullHelp() [][]key.Binding {
60 m := [][]key.Binding{}
61 slice := k.KeyBindings()
62 for i := 0; i < len(slice); i += 4 {
63 end := min(i+4, len(slice))
64 m = append(m, slice[i:end])
69// ShortHelp implements help.KeyMap.
70func (k KeyMap) ShortHelp() []key.Binding {
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list