4 "charm.land/bubbles/v2/key"
19 ScrollRight key.Binding
22func DefaultKeyMap() KeyMap {
25 key.WithKeys("left", "h"),
26 key.WithHelp("←", "previous"),
28 Right: key.NewBinding(
29 key.WithKeys("right", "l"),
30 key.WithHelp("→", "next"),
34 key.WithHelp("tab", "switch"),
36 Allow: key.NewBinding(
37 key.WithKeys("a", "A", "ctrl+a"),
38 key.WithHelp("a", "allow"),
40 AllowSession: key.NewBinding(
41 key.WithKeys("s", "S", "ctrl+s"),
42 key.WithHelp("s", "allow session"),
45 key.WithKeys("d", "D", "esc"),
46 key.WithHelp("d", "deny"),
48 Select: key.NewBinding(
49 key.WithKeys("enter", "ctrl+y"),
50 key.WithHelp("enter", "confirm"),
52 ToggleDiffMode: key.NewBinding(
54 key.WithHelp("t", "toggle diff mode"),
56 ScrollDown: key.NewBinding(
57 key.WithKeys("shift+down", "J"),
58 key.WithHelp("shift+↓", "scroll down"),
60 ScrollUp: key.NewBinding(
61 key.WithKeys("shift+up", "K"),
62 key.WithHelp("shift+↑", "scroll up"),
64 ScrollLeft: key.NewBinding(
65 key.WithKeys("shift+left", "H"),
66 key.WithHelp("shift+←", "scroll left"),
68 ScrollRight: key.NewBinding(
69 key.WithKeys("shift+right", "L"),
70 key.WithHelp("shift+→", "scroll right"),
75// KeyBindings implements layout.KeyMapProvider
76func (k KeyMap) KeyBindings() []key.Binding {
93// FullHelp implements help.KeyMap.
94func (k KeyMap) FullHelp() [][]key.Binding {
95 m := [][]key.Binding{}
96 slice := k.KeyBindings()
97 for i := 0; i < len(slice); i += 4 {
98 end := min(i+4, len(slice))
99 m = append(m, slice[i:end])
104// ShortHelp implements help.KeyMap.
105func (k KeyMap) ShortHelp() []key.Binding {
106 return []key.Binding{
109 key.WithKeys("shift+left", "shift+down", "shift+up", "shift+right"),
110 key.WithHelp("shift+←↓↑→", "scroll"),
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