3import "charm.land/bubbles/v2/key"
8 SendMessage key.Binding
12 MentionFile key.Binding
14 // Attachments key maps
15 AttachmentDeleteMode key.Binding
17 DeleteAllAttachments key.Binding
21 NewSession key.Binding
22 AddAttachment key.Binding
28 DownOneItem key.Binding
32 HalfPageDown key.Binding
33 HalfPageUp key.Binding
55func DefaultKeyMap() KeyMap {
58 key.WithKeys("ctrl+c"),
59 key.WithHelp("ctrl+c", "quit"),
62 key.WithKeys("ctrl+g"),
63 key.WithHelp("ctrl+g", "more"),
65 Commands: key.NewBinding(
66 key.WithKeys("ctrl+p"),
67 key.WithHelp("ctrl+p", "commands"),
69 Models: key.NewBinding(
70 key.WithKeys("ctrl+m", "ctrl+l"),
71 key.WithHelp("ctrl+l", "models"),
73 Suspend: key.NewBinding(
74 key.WithKeys("ctrl+z"),
75 key.WithHelp("ctrl+z", "suspend"),
77 Sessions: key.NewBinding(
78 key.WithKeys("ctrl+s"),
79 key.WithHelp("ctrl+s", "sessions"),
83 key.WithHelp("tab", "change focus"),
87 km.Editor.AddFile = key.NewBinding(
89 key.WithHelp("/", "add file"),
91 km.Editor.SendMessage = key.NewBinding(
92 key.WithKeys("enter"),
93 key.WithHelp("enter", "send"),
95 km.Editor.OpenEditor = key.NewBinding(
96 key.WithKeys("ctrl+o"),
97 key.WithHelp("ctrl+o", "open editor"),
99 km.Editor.Newline = key.NewBinding(
100 key.WithKeys("shift+enter", "ctrl+j"),
101 // "ctrl+j" is a common keybinding for newline in many editors. If
102 // the terminal supports "shift+enter", we substitute the help tex
104 key.WithHelp("ctrl+j", "newline"),
106 km.Editor.AddImage = key.NewBinding(
107 key.WithKeys("ctrl+f"),
108 key.WithHelp("ctrl+f", "add image"),
110 km.Editor.MentionFile = key.NewBinding(
112 key.WithHelp("@", "mention file"),
114 km.Editor.AttachmentDeleteMode = key.NewBinding(
115 key.WithKeys("ctrl+r"),
116 key.WithHelp("ctrl+r+{i}", "delete attachment at index i"),
118 km.Editor.Escape = key.NewBinding(
119 key.WithKeys("esc", "alt+esc"),
120 key.WithHelp("esc", "cancel delete mode"),
122 km.Editor.DeleteAllAttachments = key.NewBinding(
124 key.WithHelp("ctrl+r+r", "delete all attachments"),
127 km.Chat.NewSession = key.NewBinding(
128 key.WithKeys("ctrl+n"),
129 key.WithHelp("ctrl+n", "new session"),
131 km.Chat.AddAttachment = key.NewBinding(
132 key.WithKeys("ctrl+f"),
133 key.WithHelp("ctrl+f", "add attachment"),
135 km.Chat.Cancel = key.NewBinding(
136 key.WithKeys("esc", "alt+esc"),
137 key.WithHelp("esc", "cancel"),
139 km.Chat.Tab = key.NewBinding(
141 key.WithHelp("tab", "change focus"),
143 km.Chat.Details = key.NewBinding(
144 key.WithKeys("ctrl+d"),
145 key.WithHelp("ctrl+d", "toggle details"),
148 km.Chat.Down = key.NewBinding(
149 key.WithKeys("down", "ctrl+j", "ctrl+n", "j"),
150 key.WithHelp("↓", "down"),
152 km.Chat.Up = key.NewBinding(
153 key.WithKeys("up", "ctrl+k", "ctrl+p", "k"),
154 key.WithHelp("↑", "up"),
156 km.Chat.UpOneItem = key.NewBinding(
157 key.WithKeys("shift+up", "K"),
158 key.WithHelp("shift+↑", "up one item"),
160 km.Chat.DownOneItem = key.NewBinding(
161 key.WithKeys("shift+down", "J"),
162 key.WithHelp("shift+↓", "down one item"),
164 km.Chat.HalfPageDown = key.NewBinding(
166 key.WithHelp("d", "half page down"),
168 km.Chat.PageDown = key.NewBinding(
169 key.WithKeys("pgdown", " ", "f"),
170 key.WithHelp("f/pgdn", "page down"),
172 km.Chat.PageUp = key.NewBinding(
173 key.WithKeys("pgup", "b"),
174 key.WithHelp("b/pgup", "page up"),
176 km.Chat.HalfPageUp = key.NewBinding(
178 key.WithHelp("u", "half page up"),
180 km.Chat.Home = key.NewBinding(
181 key.WithKeys("g", "home"),
182 key.WithHelp("g", "home"),
184 km.Chat.End = key.NewBinding(
185 key.WithKeys("G", "end"),
186 key.WithHelp("G", "end"),
189 km.Initialize.Yes = key.NewBinding(
190 key.WithKeys("y", "Y"),
191 key.WithHelp("y", "yes"),
193 km.Initialize.No = key.NewBinding(
194 key.WithKeys("n", "N", "esc", "alt+esc"),
195 key.WithHelp("n", "no"),
197 km.Initialize.Switch = key.NewBinding(
198 key.WithKeys("left", "right", "tab"),
199 key.WithHelp("tab", "switch"),
201 km.Initialize.Enter = key.NewBinding(
202 key.WithKeys("enter"),
203 key.WithHelp("enter", "select"),
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