4 "charm.land/bubbles/v2/key"
7type EditorKeyMap struct {
9 SendMessage key.Binding
10 OpenEditor key.Binding
14func DefaultEditorKeyMap() EditorKeyMap {
16 AddFile: key.NewBinding(
18 key.WithHelp("/", "add file"),
20 SendMessage: key.NewBinding(
21 key.WithKeys("enter"),
22 key.WithHelp("enter", "send"),
24 OpenEditor: key.NewBinding(
25 key.WithKeys("ctrl+o"),
26 key.WithHelp("ctrl+o", "open editor"),
28 Newline: key.NewBinding(
29 key.WithKeys("shift+enter", "ctrl+j"),
30 // "ctrl+j" is a common keybinding for newline in many editors. If
31 // the terminal supports "shift+enter", we substitute the help text
33 key.WithHelp("ctrl+j", "newline"),
38// KeyBindings implements layout.KeyMapProvider
39func (k EditorKeyMap) KeyBindings() []key.Binding {
45 AttachmentsKeyMaps.AttachmentDeleteMode,
46 AttachmentsKeyMaps.DeleteAllAttachments,
47 AttachmentsKeyMaps.Escape,
51type DeleteAttachmentKeyMaps struct {
52 AttachmentDeleteMode key.Binding
54 DeleteAllAttachments key.Binding
57// TODO: update this to use the new keymap concepts
58var AttachmentsKeyMaps = DeleteAttachmentKeyMaps{
59 AttachmentDeleteMode: key.NewBinding(
60 key.WithKeys("ctrl+r"),
61 key.WithHelp("ctrl+r+{i}", "delete attachment at index i"),
63 Escape: key.NewBinding(
64 key.WithKeys("esc", "alt+esc"),
65 key.WithHelp("esc", "cancel delete mode"),
67 DeleteAllAttachments: key.NewBinding(
69 key.WithHelp("ctrl+r+r", "delete all attachments"),
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