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