-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeymap.json
277 lines (271 loc) · 8.62 KB
/
keymap.json
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
// Zed keymap
//
// For information on binding keys, see the Zed
// documentation: https://zed.dev/docs/key-bindings
//
// To see the default key bindings run `zed: Open Default Keymap`
// from the command palette.
[
{
"context": "Workspace",
"bindings": {
// "shift shift": "file_finder::Toggle"
}
},
// Better escape
{
"context": "Editor && vim_mode == insert && !menu",
"bindings": {
"j j": "vim::NormalBefore", // remap jj in insert mode to escape
"j k": "vim::NormalBefore" // remap jk in insert mode to escape
}
},
{
"context": "Editor",
"bindings": {
// "j k": ["workspace::SendKeystrokes", "escape"]
}
},
{
"context": "Editor && (vim_mode == normal || vim_mode == visual) && !VimWaiting && !menu",
"bindings": {
// put key-bindings here if you want them to work in normal & visual mode
// Git
"space g h d": "editor::ToggleHunkDiff",
"space g h r": "editor::RevertSelectedHunks",
// Open markdown preview
"space m p": "markdown::OpenPreview",
"space m P": "markdown::OpenPreviewToTheSide",
// Open recent project
"space f p": "projects::OpenRecent",
// Search word under cursor
"space s w": "pane::DeploySearch",
// Chat with AI
"space a c": "assistant::ToggleFocus",
// Go to file with `gf`
"g f": "editor::OpenExcerpts"
}
},
{
"context": "Editor && vim_mode == normal && !VimWaiting && !menu",
"bindings": {
// put key-bindings here if you want them to work only in normal mode
// Window movement bindings
// Ctrl jklk to move between panes
"ctrl-h": ["workspace::ActivatePaneInDirection", "Left"],
"ctrl-l": ["workspace::ActivatePaneInDirection", "Right"],
"ctrl-k": ["workspace::ActivatePaneInDirection", "Up"],
"ctrl-j": ["workspace::ActivatePaneInDirection", "Down"],
// +LSP
"space c a": "editor::ToggleCodeActions",
"space .": "editor::ToggleCodeActions",
"space c r": "editor::Rename",
"g d": "editor::GoToDefinition",
"g D": "editor::GoToDefinitionSplit",
"g i": "editor::GoToImplementation",
"g I": "editor::GoToImplementationSplit",
"g t": "editor::GoToTypeDefinition",
"g T": "editor::GoToTypeDefinitionSplit",
"g r": "editor::FindAllReferences",
"] d": "editor::GoToDiagnostic",
"[ d": "editor::GoToPrevDiagnostic",
// TODO: Go to next/prev error
"] e": "editor::GoToDiagnostic",
"[ e": "editor::GoToPrevDiagnostic",
// Symbol search
"s s": "outline::Toggle",
"s S": "project_symbols::Toggle",
// Diagnostic
"space x x": "diagnostics::Deploy",
// +Git
// Git prev/next hunk
"] h": "editor::GoToHunk",
"[ h": "editor::GoToPrevHunk",
// + Buffers
// Switch between buffers
"shift-tab": "pane::ActivatePrevItem",
"tab": "pane::ActivateNextItem",
// Close active panel
"shift-q": "pane::CloseActiveItem",
"ctrl-q": "pane::CloseActiveItem",
"space b d": "pane::CloseActiveItem",
// Close other items
"space b o": "pane::CloseInactiveItems",
// Save file
"ctrl-s": "workspace::Save",
// File finder
"space space": "file_finder::Toggle",
// TODO: Open other files
// Show project panel with current file
"space e": "pane::RevealInProjectPanel"
}
},
// Empty pane, set of keybindings that are available when there is no active editor
{
"context": "EmptyPane || SharedScreen",
"bindings": {
// Open file finder
"space space": "file_finder::Toggle",
// Open recent project
"space f p": "projects::OpenRecent"
}
},
{
"context": "Terminal",
"bindings": {
"ctrl-h": ["workspace::ActivatePaneInDirection", "Left"],
"ctrl-l": ["workspace::ActivatePaneInDirection", "Right"],
"ctrl-k": ["workspace::ActivatePaneInDirection", "Up"],
"ctrl-j": ["workspace::ActivatePaneInDirection", "Down"]
}
},
// File panel (netrw)
{
"context": "ProjectPanel && not_editing",
"bindings": {
"a": "project_panel::NewFile",
"A": "project_panel::NewDirectory",
"r": "project_panel::Rename",
"d": "project_panel::Delete",
"x": "project_panel::Cut",
"c": "project_panel::Copy",
"p": "project_panel::Paste",
// Close project panel as project file panel on the right
"q": "workspace::ToggleRightDock",
"space e": "workspace::ToggleRightDock",
// Navigate between panel
"ctrl-h": ["workspace::ActivatePaneInDirection", "Left"],
"ctrl-l": ["workspace::ActivatePaneInDirection", "Right"],
"ctrl-k": ["workspace::ActivatePaneInDirection", "Up"],
"ctrl-j": ["workspace::ActivatePaneInDirection", "Down"]
}
},
{
"context": "Editor && VimControl && !VimWaiting && !menu",
"bindings": {
"ctrl-w z": "workspace::ToggleZoom",
"ctrl-w t": "terminal_panel::ToggleFocus",
"g r": "editor::FindAllReferences",
"shift-k": "editor::Hover",
"space l a": "editor::ToggleCodeActions",
"space l r": "editor::Rename",
"space l f": "editor::Format",
"space l l": "diagnostics::Deploy",
"g c c": "editor::ToggleComments",
"space f": "file_finder::Toggle",
"space o": "tab_switcher::Toggle",
"space e": "workspace::ToggleLeftDock",
"space p": "outline::Toggle",
"space v": "editor::GoToDefinitionSplit"
}
},
{
"context": "Editor && vim_mode == insert && !menu",
"bindings": {
"j j": "vim::NormalBefore"
}
},
{
"context": "Editor && vim_mode == visual && !VimWaiting && !VimObject",
"bindings": {
"shift-j": "editor::MoveLineDown",
"shift-k": "editor::MoveLineUp"
}
},
{
"context": "Terminal",
"bindings": {
"ctrl-w z": "workspace::ToggleZoom",
"ctrl-w t": "terminal_panel::ToggleFocus"
}
},
{
"context": "Editor",
"bindings": {
"super-[": "editor::Outdent",
"super-]": "editor::Indent",
"super-alt-up": "editor::AddSelectionAbove",
"super-ctrl-p": "editor::AddSelectionAbove",
"super-alt-down": "editor::AddSelectionBelow",
"super-ctrl-n": "editor::AddSelectionBelow",
"super-d": [
"editor::SelectNext",
{
"replace_newest": false
}
],
"ctrl-super-d": [
"editor::SelectPrevious",
{
"replace_newest": false
}
],
"super-k super-d": [
"editor::SelectNext",
{
"replace_newest": true
}
],
"super-k ctrl-super-d": [
"editor::SelectPrevious",
{
"replace_newest": true
}
],
"super-/": [
"editor::ToggleComments",
{
"advance_downwards": false
}
],
"alt-up": "editor::SelectLargerSyntaxNode",
"alt-down": "editor::SelectSmallerSyntaxNode",
"super-u": "editor::UndoSelection",
"super-shift-u": "editor::RedoSelection",
"f8": "editor::GoToDiagnostic",
"shift-f8": "editor::GoToPrevDiagnostic",
"f2": "editor::Rename",
"f12": "editor::GoToDefinition",
"alt-f12": "editor::GoToDefinitionSplit",
"super-f12": "editor::GoToTypeDefinition",
"alt-super-f12": "editor::GoToTypeDefinitionSplit",
"alt-shift-f12": "editor::FindAllReferences",
"ctrl-m": "editor::MoveToEnclosingBracket",
"alt-super-[": "editor::Fold",
"alt-super-]": "editor::UnfoldLines",
"ctrl-space": "editor::ShowCompletions",
"super-.": "editor::ToggleCodeActions"
}
},
{
"context": "Editor && !menu",
"bindings": {
"ctrl-c": "editor::Copy", // vim default: return to normal mode
"ctrl-x": "editor::Cut", // vim default: decrement
"ctrl-v": "editor::Paste", // vim default: visual block mode
"ctrl-y": "editor::Undo", // vim default: line up
"ctrl-f": "buffer_search::Deploy", // vim default: page down
"ctrl-o": "workspace::Open", // vim default: go back
"ctrl-a": "editor::SelectAll" // vim default: increment
}
},
{
"context": "VimControl && !menu && vim_mode != operator",
"bindings": {
"w": "vim::NextSubwordStart",
"b": "vim::PreviousSubwordStart",
"e": "vim::NextSubwordEnd",
"g e": "vim::PreviousSubwordEnd"
}
},
{
"context": "Dock",
"bindings": {
"ctrl-w h": ["workspace::ActivatePaneInDirection", "Left"],
"ctrl-w l": ["workspace::ActivatePaneInDirection", "Right"],
"ctrl-w k": ["workspace::ActivatePaneInDirection", "Up"],
"ctrl-w j": ["workspace::ActivatePaneInDirection", "Down"]
// ... or other keybindings
}
}
]