-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkeymap.go
More file actions
53 lines (45 loc) · 929 Bytes
/
keymap.go
File metadata and controls
53 lines (45 loc) · 929 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package main
import (
"github.com/charmbracelet/bubbles/key"
)
var (
nextTab = key.NewBinding(
key.WithKeys("tab", "right"),
key.WithHelp("tab/→", "switch tab"),
)
selectUserEnterKey = key.NewBinding(
key.WithKeys("enter"),
key.WithHelp("enter", "select"),
)
deleteUserEnterKey = key.NewBinding(
key.WithKeys("backspace"),
key.WithHelp("backspace", "delete"),
)
configModeChange = key.NewBinding(
key.WithKeys("ctrl+g"),
key.WithHelp("ctrl+g", "switch git config type"),
)
resetForm = key.NewBinding(
key.WithKeys("ctrl+r"),
key.WithHelp("ctrl+r", "Reset Form"),
)
quit = key.NewBinding(
key.WithKeys("ctrl+c"),
key.WithHelp("ctrl+c", "quit"),
)
)
func userListKeys() []key.Binding {
return []key.Binding{
nextTab,
configModeChange,
selectUserEnterKey,
deleteUserEnterKey,
}
}
func addUserKeys() []key.Binding {
return []key.Binding{
nextTab,
resetForm,
quit,
}
}