1Zed can be configured via a simple JSON file located at `~/.config/zed/keymap.json`.
2
3## Predefined keymaps
4
5We have a growing collection of pre-defined keymaps in [zed repository's keymaps folder](https://github.com/zed-industries/zed/tree/main/assets/keymaps).
6
7A selection of base keymaps is available in the welcome screen under the "Choose a keymap" option.
8
9Additionally, you can change the base keymap from the command palette - `β-Shift-P` - by selecting the "welcome: toggle base keymap selector" command.
10
11
12## Custom key bindings
13
14### Accessing custom key bindings
15
16You can open `keymap.json` via `β` + `K`, `β` + `S`, the command palette, or the `Zed > Settings > Open Key Bindings` application menu item.
17
18### Adding a custom key binding
19
20To customize key bindings, specify a context and the list of bindings to set. Re-mapping an existing binding will clobber the existing binding in favor of the custom one.
21
22An example of adding a set of custom key bindings:
23
24```json
25[
26 {
27 "context": "Editor",
28 "bindings": {
29 "ctrl-w": "editor::SelectLargerSyntaxNode",
30 "ctrl-shift-W": "editor::SelectSmallerSyntaxNode",
31 "ctrl-c": "editor::Cancel"
32 }
33 }
34]
35```
36
37You can see more examples in Zed's [`default.json`](https://zed.dev/ref/default.json)
38
39_There are some key bindings that can't be overridden; we are working on an issue surrounding this._
40
41## Special Keyboard Layouts
42Some people have unique and custom keyboard layouts.
43
44For example, [@TomPlanche](https://github.com/TomPlanche) having a [French keyboard](https%3A%2F%2Fcdn.shopify.com%2Fs%2Ffiles%2F1%2F0810%2F3669%2Ffiles%2Ffrench-azerty-mac-keyboard-layout-2021-keyshorts.png&f=1&nofb=1&ipt=f53a06c5e60a20b621082410aa699c8cceff269a11ff90b3b5a35c6124dbf827&ipo=images), had to type `Shift-Alt-(` in order to have a simple `[` so he made a simple layout with those 'rules':
45`ΓΉ -> [`, `backtick -> ]`, `Alt-[ (where [ is the old ΓΉ) -> {`, `Alt-] -> }`.
46But, it was impossible to take into account the `{` and `}` when he was typing so now, in order to ignore a binding, he can add `null` to the binding:
47```json
48[
49 {
50 "context": "Editor",
51 "bindings": {
52 "alt-[": null,
53 "alt-]": null
54 }
55 }
56]
57```
58
59
60## All key bindings
61
62### Global
63
64| **Command** | **Target** | **Default Shortcut** |
65| -------------------------------- | -------------- | ----------------------------- |
66| Open recent | Branches | `Alt` + `β` + `B` |
67| Toggle focus | Collab Panel | `β` + `Shift` + `C` |
68| Toggle inlay hints | Editor | `Control` + `:` |
69| Cancel | Menu | `Control` + `C` |
70| Cancel | Menu | `Escape` |
71| Confirm | Menu | `Enter` |
72| Secondary confirm | Menu | `β` + `Enter` |
73| Select first | Menu | `β` + `Up` |
74| Select first | Menu | `Page Up` |
75| Select first | Menu | `Shift` + `Page Down` |
76| Select first | Menu | `Shift` + `Page Up` |
77| Select last | Menu | `β` + `Down` |
78| Select last | Menu | `Page Down` |
79| Select next | Menu | `Control` + `N` |
80| Select next | Menu | `Down` |
81| Select prev | Menu | `Control` + `P` |
82| Select prev | Menu | `Up` |
83| Show context menu | Menu | `Control` + `Enter` |
84| Activate next item | Pane | `Alt` + `β` + `Right` |
85| Activate next item | Pane | `β` + `}` |
86| Activate prev item | Pane | `Alt` + `β` + `Left` |
87| Activate prev item | Pane | `β` + `{` |
88| Close active item | Pane | `β` + `W` |
89| Close all items | Pane | `β` + `K`, `β` + `W` |
90| Close clean items | Pane | `β` + `K`, `U` |
91| Close inactive items | Pane | `Alt` + `β` + `T` |
92| Open recent | Projects | `Alt` + `β` + `O` |
93| Toggle focus | Terminal Panel | `Control` + `` ` `` |
94| Activate pane in direction down | Workspace | `β` + `K`, `β` + `Down` |
95| Activate pane in direction left | Workspace | `β` + `K`, `β` + `Left` |
96| Activate pane in direction right | Workspace | `β` + `K`, `β` + `Right` |
97| Activate pane in direction up | Workspace | `β` + `K`, `β` + `Up` |
98| Close inactive tabs and panes | Workspace | `Control` + `Alt` + `β` + `W` |
99| Close window | Workspace | `β` + `Shift` + `W` |
100| Follow next collaborator | Workspace | `Control` + `Alt` + `β` + `F` |
101| New file | Workspace | `β` + `N` |
102| New terminal | Workspace | `Control` + `~` |
103| New window | Workspace | `β` + `Shift` + `N` |
104| Open | Workspace | `β` + `O` |
105| Save | Workspace | `β` + `S` |
106| Save as | Workspace | `β` + `Shift` + `S` |
107| Swap pane in direction | Workspace | `β` + `K`, `Shift` + `Down` |
108| Swap pane in direction | Workspace | `β` + `K`, `Shift` + `Left` |
109| Swap pane in direction | Workspace | `β` + `K`, `Shift` + `Right` |
110| Swap pane in direction | Workspace | `β` + `K`, `Shift` + `Up` |
111| Toggle zoom | Workspace | `Shift` + `Escape` |
112| Debug elements | Zed | `β` + `Alt` + `I` |
113| Decrease buffer font size | Zed | `β` + `` ` `` |
114| Hide | Zed | `β` + `H` |
115| Hide others | Zed | `Alt` + `β` + `H` |
116| Increase buffer font size | Zed | `β` + `+` |
117| Increase buffer font size | Zed | `β` + `=` |
118| Minimize | Zed | `β` + `M` |
119| Open settings | Zed | `β` + `,` |
120| Quit | Zed | `β` + `Q` |
121| Reset buffer font size | Zed | `β` + `0` |
122| Toggle full screen | Zed | `Control` + `β` + `F` |
123
124### Editor
125
126| **Command** | **Target** | **Default Shortcut** |
127| -------------------------------- | ---------- | ------------------------------------- |
128| Inline assist | Assistant | `Control` + `Enter` |
129| Add selection above | Editor | `β` + `Alt` + `Up` |
130| Add selection above | Editor | `β` + `Control` + `P` |
131| Add selection below | Editor | `β` + `Alt` + `Down` |
132| Add selection below | Editor | `β` + `Control` + `N` |
133| Backspace | Editor | `Backspace` |
134| Backspace | Editor | `Control` + `H` |
135| Backspace | Editor | `Shift` + `Backspace` |
136| Cancel | Editor | `Escape` |
137| Confirm code action | Editor | `Enter` |
138| Confirm completion | Editor | `Enter` |
139| Confirm completion | Editor | `Tab` |
140| Confirm rename | Editor | `Enter` |
141| Context menu first | Editor | `Page Up` |
142| Context menu last | Editor | `Page Down` |
143| Context menu next | Editor | `Control` + `N` |
144| Context menu next | Editor | `Down` |
145| Context menu prev | Editor | `Control` + `P` |
146| Context menu prev | Editor | `Up` |
147| Copy | Editor | `β` + `C` |
148| Cut | Editor | `β` + `X` |
149| Cut to end of line | Editor | `Control` + `K` |
150| Delete | Editor | `Control` + `D` |
151| Delete | Editor | `Delete` |
152| Delete line | Editor | `Control` + `Shift` + `K` |
153| Delete to beginning of line | Editor | `β` + `Backspace` |
154| Delete to end of line | Editor | `β` + `Delete` |
155| Delete to next subword end | Editor | `Control` + `Alt` + `D` |
156| Delete to next subword end | Editor | `Control` + `Alt` + `Delete` |
157| Delete to next word end | Editor | `Alt` + `D` |
158| Delete to next word end | Editor | `Alt` + `Delete` |
159| Delete to previous subword start | Editor | `Control` + `Alt` + `Backspace` |
160| Delete to previous subword start | Editor | `Control` + `Alt` + `H` |
161| Delete to previous word start | Editor | `Alt` + `Backspace` |
162| Delete to previous word start | Editor | `Alt` + `H` |
163| Duplicate line | Editor | `β` + `Shift` + `D` |
164| Find all references | Editor | `Alt` + `Shift` + `F12` |
165| Fold | Editor | `Alt` + `β` + `[` |
166| Format | Editor | `β` + `Shift` + `I` |
167| Go to definition | Editor | `F12` |
168| Go to definition split | Editor | `Alt` + `F12` |
169| Go to diagnostic | Editor | `F8` |
170| Go to hunk | Editor | `β` + `F8` |
171| Go to prev diagnostic | Editor | `Shift` + `F8` |
172| Go to prev hunk | Editor | `β` + `Shift` + `F8` |
173| Go to type definition | Editor | `β` + `F12` |
174| Go to type definition split | Editor | `Alt` + `β` + `F12` |
175| Hover | Editor | `β` + `K`, `β` + `I` |
176| Indent | Editor | `β` + `]` |
177| Join lines | Editor | `Control` + `J` |
178| Move down | Editor | `Control` + `N` |
179| Move down | Editor | `Down` |
180| Move left | Editor | `Control` + `B` |
181| Move left | Editor | `Left` |
182| Move line down | Editor | `Control` + `β` + `Down` |
183| Move line up | Editor | `Control` + `β` + `Up` |
184| Move page down | Editor | `Control` + `V` |
185| Move page down | Editor | `Shift` + `Page Down` |
186| Move page up | Editor | `Alt` + `V` |
187| Move page up | Editor | `Shift` + `Page Up` |
188| Move right | Editor | `Control` + `F` |
189| Move right | Editor | `Right` |
190| Move to beginning | Editor | `β` + `Up` |
191| Move to beginning of line | Editor | `β` + `Left` |
192| Move to beginning of line | Editor | `Control` + `A` |
193| Move to beginning of line | Editor | `Home` |
194| Move to enclosing bracket | Editor | `Control` + `M` |
195| Move to end | Editor | `β` + `Down` |
196| Move to end of line | Editor | `β` + `Right` |
197| Move to end of line | Editor | `Control` + `E` |
198| Move to end of line | Editor | `End` |
199| Move to end of paragraph | Editor | `Control` + `Down` |
200| Move to next subword end | Editor | `Control` + `Alt` + `F` |
201| Move to next subword end | Editor | `Control` + `Alt` + `Right` |
202| Move to next word end | Editor | `Alt` + `F` |
203| Move to next word end | Editor | `Alt` + `Right` |
204| Move to previous subword start | Editor | `Control` + `Alt` + `B` |
205| Move to previous subword start | Editor | `Control` + `Alt` + `Left` |
206| Move to previous word start | Editor | `Alt` + `B` |
207| Move to previous word start | Editor | `Alt` + `Left` |
208| Move to start of paragraph | Editor | `Control` + `Up` |
209| Move up | Editor | `Control` + `P` |
210| Move up | Editor | `Up` |
211| Next screen | Editor | `Control` + `L` |
212| Open excerpts | Editor | `Alt` + `Enter` |
213| Outdent | Editor | `β` + `[` |
214| Page down | Editor | `Page Down` |
215| Page up | Editor | `Page Up` |
216| Paste | Editor | `β` + `V` |
217| Redo | Editor | `β` + `Shift` + `Z` |
218| Redo selection | Editor | `β` + `Shift` + `U` |
219| Rename | Editor | `F2` |
220| Reveal in finder | Editor | `Alt` + `β` + `R` |
221| Select all | Editor | `β` + `A` |
222| Select all matches | Editor | `β` + `Shift` + `L` |
223| Select down | Editor | `Control` + `Shift` + `N` |
224| Select down | Editor | `Shift` + `Down` |
225| Select larger syntax node | Editor | `Alt` + `Up` |
226| Select left | Editor | `Control` + `Shift` + `B` |
227| Select left | Editor | `Shift` + `Left` |
228| Select line | Editor | `β` + `L` |
229| Select next | Editor | `β` + `D` |
230| Select next | Editor | `β` + `K`, `β` + `D` |
231| Select previous | Editor | `β` + `K`, `Control` + `β` + `D` |
232| Select previous | Editor | `Control` + `β` + `D` |
233| Select right | Editor | `Control` + `Shift` + `F` |
234| Select right | Editor | `Shift` + `Right` |
235| Select smaller syntax node | Editor | `Alt` + `Down` |
236| Select to beginning | Editor | `β` + `Shift` + `Up` |
237| Select to beginning of line | Editor | `β` + `Shift` + `Left` |
238| Select to beginning of line | Editor | `Control` + `Shift` + `A` |
239| Select to beginning of line | Editor | `Shift` + `Home` |
240| Select to end | Editor | `β` + `Shift` + `Down` |
241| Select to end of line | Editor | `β` + `Shift` + `Right` |
242| Select to end of line | Editor | `Control` + `Shift` + `E` |
243| Select to end of line | Editor | `Shift` + `End` |
244| Select to end of paragraph | Editor | `Control` + `Shift` + `Down` |
245| Select to next subword end | Editor | `Control` + `Alt` + `Shift` + `F` |
246| Select to next subword end | Editor | `Control` + `Alt` + `Shift` + `Right` |
247| Select to next word end | Editor | `Alt` + `Shift` + `F` |
248| Select to next word end | Editor | `Alt` + `Shift` + `Right` |
249| Select to previous subword start | Editor | `Control` + `Alt` + `Shift` + `B` |
250| Select to previous subword start | Editor | `Control` + `Alt` + `Shift` + `Left` |
251| Select to previous word start | Editor | `Alt` + `Shift` + `B` |
252| Select to previous word start | Editor | `Alt` + `Shift` + `Left` |
253| Select to start of paragraph | Editor | `Control` + `Shift` + `Up` |
254| Select up | Editor | `Control` + `Shift` + `P` |
255| Select up | Editor | `Shift` + `Up` |
256| Show character palette | Editor | `Control` + `β` + `Space` |
257| Show completions | Editor | `Control` + `Space` |
258| Tab | Editor | `Tab` |
259| Tab prev | Editor | `Shift` + `Tab` |
260| Toggle code actions | Editor | `β` + `.` |
261| Toggle comments | Editor | `β` + `/` |
262| Transpose | Editor | `Control` + `T` |
263| Undo | Editor | `β` + `Z` |
264| Undo selection | Editor | `β` + `U` |
265| Unfold lines | Editor | `Alt` + `β` + `]` |
266
267### Editor (Full Only)
268
269| **Command** | **Target** | **Default Shortcut** |
270| ------------------- | ------------- | ----------------------- |
271| Quote selection | Assistant | `β` + `>` |
272| Deploy | Buffer Search | `β` + `E` |
273| Deploy | Buffer Search | `β` + `F` |
274| Next suggestion | Copilot | `Alt` + `]` |
275| Previous suggestion | Copilot | `Alt` + `[` |
276| Suggest | Copilot | `Alt` + `\` |
277| Newline | Editor | `Enter` |
278| Newline | Editor | `Shift` + `Enter` |
279| Newline above | Editor | `β` + `Shift` + `Enter` |
280| Newline below | Editor | `β` + `Enter` |
281| Toggle soft wrap | Editor | `Alt` + `Z` |
282| Toggle | Go To Line | `Control` + `G` |
283| Toggle | Outline | `β` + `Shift` + `O` |
284
285### Editor (Auto Height Only)
286
287| **Command** | **Target** | **Default Shortcut** |
288| ------------- | ---------- | ----------------------------- |
289| Newline | Editor | `Control` + `Enter` |
290| Newline below | Editor | `Control` + `Shift` + `Enter` |
291
292### Pane
293
294| **Command** | **Target** | **Default Shortcut** |
295| ---------------------- | -------------- | -------------------- |
296| Activate item 1 | Pane | `Control` + `1` |
297| Activate item 2 | Pane | `Control` + `2` |
298| Activate item 3 | Pane | `Control` + `3` |
299| Activate item 4 | Pane | `Control` + `4` |
300| Activate item 5 | Pane | `Control` + `5` |
301| Activate item 6 | Pane | `Control` + `6` |
302| Activate item 7 | Pane | `Control` + `7` |
303| Activate item 8 | Pane | `Control` + `8` |
304| Activate item 9 | Pane | `Control` + `9` |
305| Activate last item | Pane | `Control` + `0` |
306| Go back | Pane | `Control` + `-` |
307| Go forward | Pane | `Control` + `_` |
308| Reopen closed item | Pane | `β` + `Shift` + `T` |
309| Split down | Pane | `β` + `K`, `Down` |
310| Split left | Pane | `β` + `K`, `Left` |
311| Split right | Pane | `β` + `K`, `Right` |
312| Split up | Pane | `β` + `K`, `Up` |
313| Toggle filters | Project Search | `Alt` + `β` + `F` |
314| Toggle focus | Project Search | `β` + `F` |
315| Toggle focus | Project Search | `β` + `Shift` + `F` |
316| Activate regex mode | Search | `Alt` + `β` + `G` |
317| Activate semantic mode | Search | `Alt` + `β` + `S` |
318| Activate text mode | Search | `Alt` + `β` + `X` |
319| Cycle mode | Search | `Alt` + `Tab` |
320| Select all matches | Search | `Alt` + `Enter` |
321| Select next match | Search | `β` + `G` |
322| Select prev match | Search | `β` + `Shift` + `G` |
323| Toggle case sensitive | Search | `Alt` + `β` + `C` |
324| Toggle replace | Search | `β` + `Shift` + `H` |
325| Toggle whole word | Search | `Alt` + `β` + `W` |
326
327### Buffer Search Bar
328
329| **Command** | **Target** | **Default Shortcut** |
330| ---------------------- | ------------- | -------------------- |
331| Dismiss | Buffer Search | `Escape` |
332| Focus editor | Buffer Search | `Tab` |
333| Cycle mode | Search | `Alt` + `Tab` |
334| Next history query | Search | `Down` |
335| Previous history query | Search | `Up` |
336| Replace all | Search | `Command + Enter` |
337| Replace next | Search | `Enter` |
338| Select all matches | Search | `Alt` + `Enter` |
339| Select next match | Search | `Enter` |
340| Select prev match | Search | `Shift` + `Enter` |
341
342### Workspace
343
344| **Command** | **Target** | **Default Shortcut** |
345| ------------------ | ----------------- | -------------------- |
346| Toggle focus | Assistant | `β` + `?` |
347| Toggle | Command Palette | `β` + `Shift` + `P` |
348| Deploy | Diagnostics | `β` + `Shift` + `M` |
349| Toggle | File Finder | `β` + `P` |
350| Toggle | Language Selector | `β` + `K`, `M` |
351| Toggle focus | Project Panel | `β` + `Shift` + `E` |
352| Toggle | Project Symbols | `β` + `T` |
353| Toggle | Theme Selector | `β` + `K`, `β` + `T` |
354| Activate pane 1 | Workspace | `β` + `1` |
355| Activate pane 2 | Workspace | `β` + `2` |
356| Activate pane 3 | Workspace | `β` + `3` |
357| Activate pane 4 | Workspace | `β` + `4` |
358| Activate pane 5 | Workspace | `β` + `5` |
359| Activate pane 6 | Workspace | `β` + `6` |
360| Activate pane 7 | Workspace | `β` + `7` |
361| Activate pane 8 | Workspace | `β` + `8` |
362| Activate pane 9 | Workspace | `β` + `9` |
363| Close all docks | Workspace | `Alt` + `β` + `Y` |
364| New search | Workspace | `β` + `Shift` + `F` |
365| Save all | Workspace | `β` + `Alt` + `S` |
366| Toggle bottom dock | Workspace | `β` + `J` |
367| Toggle left dock | Workspace | `β` + `B` |
368| Toggle right dock | Workspace | `β` + `R` |
369| Open keymap | Zed | `β` + `K`, `β` + `S` |
370
371### Project Panel
372
373| **Command** | **Target** | **Default Shortcut** |
374| ----------------------- | ------------- | --------------------------- |
375| Collapse selected entry | Project Panel | `Left` |
376| Copy | Project Panel | `β` + `C` |
377| Copy path | Project Panel | `β` + `Alt` + `C` |
378| Copy relative path | Project Panel | `Alt` + `β` + `Shift` + `C` |
379| Cut | Project Panel | `β` + `X` |
380| Delete | Project Panel | `Backspace` |
381| Expand selected entry | Project Panel | `Right` |
382| New directory | Project Panel | `Alt` + `β` + `N` |
383| New file | Project Panel | `Command + N` |
384| New search in directory | Project Panel | `Alt` + `Shift` + `F` |
385| Open | Project Panel | `Space` |
386| Paste | Project Panel | `β` + `V` |
387| Rename | Project Panel | `Enter` |
388| Rename | Project Panel | `F2` |
389| Reveal in finder | Project Panel | `Alt` + `β` + `R` |
390
391### Project Search Bar
392
393| **Command** | **Target** | **Default Shortcut** |
394| ---------------------- | -------------- | -------------------- |
395| Search in new | Project Search | `β` + `Enter` |
396| Toggle focus | Project Search | `Escape` |
397| Activate regex mode | Search | `Alt` + `β` + `G` |
398| Activate semantic mode | Search | `Alt` + `β` + `S` |
399| Activate text mode | Search | `Alt` + `β` + `X` |
400| Cycle mode | Search | `Alt` + `Tab` |
401| Next history query | Search | `Down` |
402| Previous history query | Search | `Up` |
403| Replace all | Search | `Command + Enter` |
404| Replace next | Search | `Enter` |
405| Toggle replace | Search | `β` + `Shift` + `H` |
406
407### Terminal
408
409| **Command** | **Target** | **Default Shortcut** |
410| --------------------------- | ---------- | ------------------------- |
411| Clear | Terminal | `β` + `K` |
412| Copy | Terminal | `β` + `C` |
413| Delete line | Terminal | `β` + `Backspace` |
414| Move to beginning of line | Terminal | `β` + `Left` |
415| Move to end of line | Terminal | `β` + `Right` |
416| Move to next word end | Terminal | `Alt` + `Right` |
417| Move to previous word start | Terminal | `Alt` + `Left` |
418| Paste | Terminal | `β` + `V` |
419| Show character palette | Terminal | `Control` + `β` + `Space` |
420
421### Assistant Editor
422
423| **Command** | **Target** | **Default Shortcut** |
424| ------------------ | ---------- | -------------------- |
425| Assist | Assistant | `β` + `Enter` |
426| Cycle message role | Assistant | `Control` + `R` |
427| Quote selection | Assistant | `β` + `>` |
428| Split | Assistant | `Shift` + `Enter` |
429| Save | Workspace | `β` + `S` |