1# Configuring Zed
2
3Zed is designed to be configured: we want to fit your workflow and preferences exactly. We provide default settings that are designed to be a comfortable starting point for as many people as possible, but we hope you will enjoy tweaking it to make it feel incredible.
4
5In addition to the settings described here, you may also want to change your [theme](./themes.md), configure your [key bindings](./key-bindings.md), set up [tasks](./tasks.md) or install [extensions](https://github.com/zed-industries/extensions).
6
7## Settings files
8
9<!--
10TBD: Settings files. Rewrite with "remote settings" in mind (e.g. `local settings` on the remote host).
11Consider renaming `zed: Open Local Settings` to `zed: Open Project Settings`.
12
13TBD: Add settings documentation about how settings are merged as overlays. E.g. project>local>default. Note how settings that are maps are merged, but settings that are arrays are replaced and must include the defaults.
14-->
15
16Your settings file can be opened with {#kb zed::OpenSettings}. By default it is located at `~/.config/zed/settings.json`, though if you have XDG_CONFIG_HOME in your environment on Linux it will be at `$XDG_CONFIG_HOME/zed/settings.json` instead.
17
18This configuration is merged with any local configuration inside your projects. You can open the project settings by running {#action zed::OpenProjectSettings} from the command palette. This will create a `.zed` directory containing`.zed/settings.json`.
19
20Although most projects will only need one settings file at the root, you can add more local settings files for subdirectories as needed. Not all settings can be set in local files, just those that impact the behavior of the editor and language tooling. For example you can set `tab_size`, `formatter` etc. but not `theme`, `vim_mode` and similar.
21
22The syntax for configuration files is a super-set of JSON that allows `//` comments.
23
24## Default settings
25
26You can find the default settings for your current Zed by running {#action zed::OpenDefaultSettings} from the command palette.
27
28Extensions that provide language servers may also provide default settings for those language servers.
29
30# Settings
31
32## Active Pane Modifiers
33
34- Description: Styling settings applied to the active pane.
35- Setting: `active_pane_modifiers`
36- Default:
37
38```json
39{
40 "active_pane_modifiers": {
41 "magnification": 1.0,
42 "border_size": 0.0,
43 "inactive_opacity": 1.0
44 }
45}
46```
47
48### Magnification
49
50- Description: Scale by which to zoom the active pane. When set to `1.0`, the active pane has the same size as others, but when set to a larger value, the active pane takes up more space.
51- Setting: `magnification`
52- Default: `1.0`
53
54**Options**
55
56`float` values
57
58### Border size
59
60- Description: Size of the border surrounding the active pane. When set to 0, the active pane doesn't have any border. The border is drawn inset.
61- Setting: `border_size`
62- Default: `0.0`
63
64**Options**
65
66Non-negative `float` values
67
68### Inactive Opacity
69
70- Description: Opacity of inactive panels. When set to 1.0, the inactive panes have the same opacity as the active one. If set to 0, the inactive panes content will not be visible at all. Values are clamped to the [0.0, 1.0] range.
71- Setting: `inactive_opacity`
72- Default: `1.0`
73
74**Options**
75
76`float` values
77
78## Auto Install extensions
79
80- Description: Define extensions to be autoinstalled or never be installed.
81- Setting: `auto_install_extension`
82- Default: `{ "html": true }`
83
84**Options**
85
86You can find the names of your currently installed extensions by listing the subfolders under the [extension installation location](./extensions/installing-extensions#installation-location):
87
88On MacOS:
89
90```sh
91ls ~/Library/Application\ Support/Zed/extensions/installed/
92```
93
94On Linux:
95
96```sh
97ls ~/.local/share/zed/extensions/installed
98```
99
100Define extensions which should be installed (`true`) or never installed (`false`).
101
102```json
103{
104 "auto_install_extensions": {
105 "html": true,
106 "dockerfile": true,
107 "docker-compose": false
108 }
109}
110```
111
112## Autosave
113
114- Description: When to automatically save edited buffers.
115- Setting: `autosave`
116- Default: `off`
117
118**Options**
119
1201. To disable autosave, set it to `off`:
121
122```json
123{
124 "autosave": "off"
125}
126```
127
1282. To autosave when focus changes, use `on_focus_change`:
129
130```json
131{
132 "autosave": "on_focus_change"
133}
134```
135
1363. To autosave when the active window changes, use `on_window_change`:
137
138```json
139{
140 "autosave": "on_window_change"
141}
142```
143
1444. To autosave after an inactivity period, use `after_delay`:
145
146```json
147{
148 "autosave": {
149 "after_delay": {
150 "milliseconds": 1000
151 }
152 }
153}
154```
155
156## Restore on Startup
157
158- Description: Controls session restoration on startup.
159- Setting: `restore_on_startup`
160- Default: `last_session`
161
162**Options**
163
1641. Restore all workspaces that were open when quitting Zed:
165
166```json
167{
168 "restore_on_startup": "last_session"
169}
170```
171
1722. Restore the workspace that was closed last:
173
174```json
175{
176 "restore_on_startup": "last_workspace"
177}
178```
179
1803. Always start with an empty editor:
181
182```json
183{
184 "restore_on_startup": "none"
185}
186```
187
188## Autoscroll on Clicks
189
190- Description: Whether to scroll when clicking near the edge of the visible text area.
191- Setting: `autoscroll_on_clicks`
192- Default: `false`
193
194**Options**
195
196`boolean` values
197
198## Auto Update
199
200- Description: Whether or not to automatically check for updates.
201- Setting: `auto_update`
202- Default: `true`
203
204**Options**
205
206`boolean` values
207
208## Base Keymap
209
210- Description: Base key bindings scheme. Base keymaps can be overridden with user keymaps.
211- Setting: `base_keymap`
212- Default: `VSCode`
213
214**Options**
215
2161. VSCode
217
218```json
219{
220 "base_keymap": "VSCode"
221}
222```
223
2242. Atom
225
226```json
227{
228 "base_keymap": "Atom"
229}
230```
231
2323. JetBrains
233
234```json
235{
236 "base_keymap": "JetBrains"
237}
238```
239
2404. None
241
242```json
243{
244 "base_keymap": "None"
245}
246```
247
2485. SublimeText
249
250```json
251{
252 "base_keymap": "SublimeText"
253}
254```
255
2566. TextMate
257
258```json
259{
260 "base_keymap": "TextMate"
261}
262```
263
264## Buffer Font Family
265
266- Description: The name of a font to use for rendering text in the editor.
267- Setting: `buffer_font_family`
268- Default: `Zed Plex Mono`
269
270**Options**
271
272The name of any font family installed on the user's system
273
274## Buffer Font Features
275
276- Description: The OpenType features to enable for text in the editor.
277- Setting: `buffer_font_features`
278- Default: `null`
279- Platform: macOS and Windows.
280
281**Options**
282
283Zed supports all OpenType features that can be enabled or disabled for a given buffer or terminal font, as well as setting values for font features.
284
285For example, to disable font ligatures, add the following to your settings:
286
287```json
288{
289 "buffer_font_features": {
290 "calt": false
291 }
292}
293```
294
295You can also set other OpenType features, like setting `cv01` to `7`:
296
297```json
298{
299 "buffer_font_features": {
300 "cv01": 7
301 }
302}
303```
304
305## Buffer Font Fallbacks
306
307- Description: Set the buffer text's font fallbacks, this will be merged with the platform's default fallbacks.
308- Setting: `buffer_font_fallbacks`
309- Default: `null`
310- Platform: macOS and Windows.
311
312**Options**
313
314For example, to use `Nerd Font` as a fallback, add the following to your settings:
315
316```json
317{
318 "buffer_font_fallbacks": ["Nerd Font"]
319}
320```
321
322## Buffer Font Size
323
324- Description: The default font size for text in the editor.
325- Setting: `buffer_font_size`
326- Default: `15`
327
328**Options**
329
330`integer` values from `6` to `100` pixels (inclusive)
331
332## Buffer Font Weight
333
334- Description: The default font weight for text in the editor.
335- Setting: `buffer_font_weight`
336- Default: `400`
337
338**Options**
339
340`integer` values between `100` and `900`
341
342## Buffer Line Height
343
344- Description: The default line height for text in the editor.
345- Setting: `buffer_line_height`
346- Default: `"comfortable"`
347
348**Options**
349
350`"standard"`, `"comfortable"` or `{ "custom": float }` (`1` is compact, `2` is loose)
351
352## Confirm Quit
353
354- Description: Whether or not to prompt the user to confirm before closing the application.
355- Setting: `confirm_quit`
356- Default: `false`
357
358**Options**
359
360`boolean` values
361
362## Centered Layout
363
364- Description: Configuration for the centered layout mode.
365- Setting: `centered_layout`
366- Default:
367
368```json
369"centered_layout": {
370 "left_padding": 0.2,
371 "right_padding": 0.2,
372}
373```
374
375**Options**
376
377The `left_padding` and `right_padding` options define the relative width of the
378left and right padding of the central pane from the workspace when the centered layout mode is activated. Valid values range is from `0` to `0.4`.
379
380## Direnv Integration
381
382- Description: Settings for [direnv](https://direnv.net/) integration. Requires `direnv` to be installed.
383 `direnv` integration make it possible to use the environment variables set by a `direnv` configuration to detect some language servers in `$PATH` instead of installing them.
384 It also allows for those environment variables to be used in tasks.
385- Setting: `load_direnv`
386- Default: `"direct"`
387
388**Options**
389
390There are two options to choose from:
391
3921. `shell_hook`: Use the shell hook to load direnv. This relies on direnv to activate upon entering the directory. Supports POSIX shells and fish.
3932. `direct`: Use `direnv export json` to load direnv. This will load direnv directly without relying on the shell hook and might cause some inconsistencies. This allows direnv to work with any shell.
394
395## Edit Predictions
396
397- Description: Settings for edit predictions.
398- Setting: `edit_predictions`
399- Default:
400
401```json
402 "edit_predictions": {
403 "disabled_globs": [
404 "**/.env*",
405 "**/*.pem",
406 "**/*.key",
407 "**/*.cert",
408 "**/*.crt",
409 "**/.dev.vars",
410 "**/secrets.yml"
411 ]
412 }
413```
414
415**Options**
416
417### Disabled Globs
418
419- Description: A list of globs for which edit predictions should be disabled for. This list adds to a pre-existing, sensible default set of globs. Any additional ones you add are combined with them.
420- Setting: `disabled_globs`
421- Default: `["**/.env*", "**/*.pem", "**/*.key", "**/*.cert", "**/*.crt", "**/.dev.vars", "**/secrets.yml"]`
422
423**Options**
424
425List of `string` values.
426
427## Edit Predictions Disabled in
428
429- Description: A list of language scopes in which edit predictions should be disabled.
430- Setting: `edit_predictions_disabled_in`
431- Default: `[]`
432
433**Options**
434
435List of `string` values
436
4371. Don't show edit predictions in comments:
438
439```json
440"disabled_in": ["comment"]
441```
442
4432. Don't show edit predictions in strings and comments:
444
445```json
446"disabled_in": ["comment", "string"]
447```
448
4493. Only in Go, don't show edit predictions in strings and comments:
450
451```json
452{
453 "languages": {
454 "Go": {
455 "edit_predictions_disabled_in": ["comment", "string"]
456 }
457 }
458}
459```
460
461## Current Line Highlight
462
463- Description: How to highlight the current line in the editor.
464- Setting: `current_line_highlight`
465- Default: `all`
466
467**Options**
468
4691. Don't highlight the current line:
470
471```json
472"current_line_highlight": "none"
473```
474
4752. Highlight the gutter area:
476
477```json
478"current_line_highlight": "gutter"
479```
480
4813. Highlight the editor area:
482
483```json
484"current_line_highlight": "line"
485```
486
4874. Highlight the full line:
488
489```json
490"current_line_highlight": "all"
491```
492
493## Selection Highlight
494
495- Description: Whether to highlight all occurrences of the selected text in an editor.
496- Setting: `selection_highlight`
497- Default: `true`
498
499## Selection Highlight Debounce
500
501- Description: The debounce delay before querying highlights based on the selected text.
502
503- Setting: `selection_highlight_debounce`
504- Default: `50`
505
506## LSP Highlight Debounce
507
508- Description: The debounce delay before querying highlights from the language server based on the current cursor location.
509- Setting: `lsp_highlight_debounce`
510- Default: `75`
511
512## Cursor Blink
513
514- Description: Whether or not the cursor blinks.
515- Setting: `cursor_blink`
516- Default: `true`
517
518**Options**
519
520`boolean` values
521
522## Cursor Shape
523
524- Description: Cursor shape for the default editor.
525- Setting: `cursor_shape`
526- Default: `bar`
527
528**Options**
529
5301. A vertical bar:
531
532```json
533"cursor_shape": "bar"
534```
535
5362. A block that surrounds the following character:
537
538```json
539"cursor_shape": "block"
540```
541
5423. An underline / underscore that runs along the following character:
543
544```json
545"cursor_shape": "underline"
546```
547
5484. An box drawn around the following character:
549
550```json
551"cursor_shape": "hollow"
552```
553
554## Hide Mouse
555
556- Description: Determines when the mouse cursor should be hidden in an editor or input box.
557- Setting: `hide_mouse`
558- Default: `on_typing_and_movement`
559
560**Options**
561
562`boolean` values
563
564## Editor Scrollbar
565
566- Description: Whether or not to show the editor scrollbar and various elements in it.
567- Setting: `scrollbar`
568- Default:
569
570```json
571"scrollbar": {
572 "show": "auto",
573 "cursors": true,
574 "git_diff": true,
575 "search_results": true,
576 "selected_text": true,
577 "selected_symbol": true,
578 "diagnostics": "all",
579 "axes": {
580 "horizontal": true,
581 "vertical": true,
582 },
583},
584```
585
586### Show Mode
587
588- Description: When to show the editor scrollbar.
589- Setting: `show`
590- Default: `auto`
591
592**Options**
593
5941. Show the scrollbar if there's important information or follow the system's configured behavior:
595
596```json
597"scrollbar": {
598 "show": "auto"
599}
600```
601
6022. Match the system's configured behavior:
603
604```json
605"scrollbar": {
606 "show": "system"
607}
608```
609
6103. Always show the scrollbar:
611
612```json
613"scrollbar": {
614 "show": "always"
615}
616```
617
6184. Never show the scrollbar:
619
620```json
621"scrollbar": {
622 "show": "never"
623}
624```
625
626### Cursor Indicators
627
628- Description: Whether to show cursor positions in the scrollbar.
629- Setting: `cursors`
630- Default: `true`
631
632**Options**
633
634`boolean` values
635
636### Git Diff Indicators
637
638- Description: Whether to show git diff indicators in the scrollbar.
639- Setting: `git_diff`
640- Default: `true`
641
642**Options**
643
644`boolean` values
645
646### Search Results Indicators
647
648- Description: Whether to show buffer search results in the scrollbar.
649- Setting: `search_results`
650- Default: `true`
651
652**Options**
653
654`boolean` values
655
656### Selected Text Indicators
657
658- Description: Whether to show selected text occurrences in the scrollbar.
659- Setting: `selected_text`
660- Default: `true`
661
662**Options**
663
664`boolean` values
665
666### Selected Symbols Indicators
667
668- Description: Whether to show selected symbol occurrences in the scrollbar.
669- Setting: `selected_symbol`
670- Default: `true`
671
672**Options**
673
674`boolean` values
675
676### Diagnostics
677
678- Description: Which diagnostic indicators to show in the scrollbar.
679- Setting: `diagnostics`
680- Default: `all`
681
682**Options**
683
6841. Show all diagnostics:
685
686```json
687{
688 "diagnostics": "all"
689}
690```
691
6922. Do not show any diagnostics:
693
694```json
695{
696 "diagnostics": "none"
697}
698```
699
7003. Show only errors:
701
702```json
703{
704 "diagnostics": "error"
705}
706```
707
7084. Show only errors and warnings:
709
710```json
711{
712 "diagnostics": "warning"
713}
714```
715
7165. Show only errors, warnings, and information:
717
718```json
719{
720 "diagnostics": "information"
721}
722```
723
724### Axes
725
726- Description: Forcefully enable or disable the scrollbar for each axis
727- Setting: `axes`
728- Default:
729
730```json
731"scrollbar": {
732 "axes": {
733 "horizontal": true,
734 "vertical": true,
735 },
736}
737```
738
739#### Horizontal
740
741- Description: When false, forcefully disables the horizontal scrollbar. Otherwise, obey other settings.
742- Setting: `horizontal`
743- Default: `true`
744
745**Options**
746
747`boolean` values
748
749#### Vertical
750
751- Description: When false, forcefully disables the vertical scrollbar. Otherwise, obey other settings.
752- Setting: `vertical`
753- Default: `true`
754
755**Options**
756
757`boolean` values
758
759## Editor Tab Bar
760
761- Description: Settings related to the editor's tab bar.
762- Settings: `tab_bar`
763- Default:
764
765```json
766"tab_bar": {
767 "show": true,
768 "show_nav_history_buttons": true,
769 "show_tab_bar_buttons": true
770}
771```
772
773### Show
774
775- Description: Whether or not to show the tab bar in the editor.
776- Setting: `show`
777- Default: `true`
778
779**Options**
780
781`boolean` values
782
783### Navigation History Buttons
784
785- Description: Whether or not to show the navigation history buttons.
786- Setting: `show_nav_history_buttons`
787- Default: `true`
788
789**Options**
790
791`boolean` values
792
793### Tab Bar Buttons
794
795- Description: Whether or not to show the tab bar buttons.
796- Setting: `show_tab_bar_buttons`
797- Default: `true`
798
799**Options**
800
801`boolean` values
802
803## Editor Tabs
804
805- Description: Configuration for the editor tabs.
806- Setting: `tabs`
807- Default:
808
809```json
810"tabs": {
811 "close_position": "right",
812 "file_icons": false,
813 "git_status": false,
814 "activate_on_close": "history",
815 "show_close_button": "hover",
816 "show_diagnostics": "off"
817},
818```
819
820### Close Position
821
822- Description: Where to display close button within a tab.
823- Setting: `close_position`
824- Default: `right`
825
826**Options**
827
8281. Display the close button on the right:
829
830```json
831{
832 "close_position": "right"
833}
834```
835
8362. Display the close button on the left:
837
838```json
839{
840 "close_position": "left"
841}
842```
843
844### File Icons
845
846- Description: Whether to show the file icon for a tab.
847- Setting: `file_icons`
848- Default: `false`
849
850### Git Status
851
852- Description: Whether or not to show Git file status in tab.
853- Setting: `git_status`
854- Default: `false`
855
856### Activate on close
857
858- Description: What to do after closing the current tab.
859- Setting: `activate_on_close`
860- Default: `history`
861
862**Options**
863
8641. Activate the tab that was open previously:
865
866```json
867{
868 "activate_on_close": "history"
869}
870```
871
8722. Activate the right neighbour tab if present:
873
874```json
875{
876 "activate_on_close": "neighbour"
877}
878```
879
8803. Activate the left neighbour tab if present:
881
882```json
883{
884 "activate_on_close": "left_neighbour"
885}
886```
887
888### Show close button
889
890- Description: Controls the appearance behavior of the tab's close button.
891- Setting: `show_close_button`
892- Default: `hover`
893
894**Options**
895
8961. Show it just upon hovering the tab:
897
898```json
899{
900 "show_close_button": "hover"
901}
902```
903
9042. Show it persistently:
905
906```json
907{
908 "show_close_button": "always"
909}
910```
911
9123. Never show it, even if hovering it:
913
914```json
915{
916 "show_close_button": "hidden"
917}
918```
919
920### Show Diagnostics
921
922- Description: Whether to show diagnostics indicators in tabs. This setting only works when file icons are active and controls which files with diagnostic issues to mark.
923- Setting: `show_diagnostics`
924- Default: `off`
925
926**Options**
927
9281. Do not mark any files:
929
930```json
931{
932 "show_diagnostics": "off"
933}
934```
935
9362. Only mark files with errors:
937
938```json
939{
940 "show_diagnostics": "errors"
941}
942```
943
9443. Mark files with errors and warnings:
945
946```json
947{
948 "show_diagnostics": "all"
949}
950```
951
952## Editor Toolbar
953
954- Description: Whether or not to show various elements in the editor toolbar.
955- Setting: `toolbar`
956- Default:
957
958```json
959"toolbar": {
960 "breadcrumbs": true,
961 "quick_actions": true,
962 "selections_menu": true
963},
964```
965
966**Options**
967
968Each option controls displaying of a particular toolbar element. If all elements are hidden, the editor toolbar is not displayed.
969
970## Enable Language Server
971
972- Description: Whether or not to use language servers to provide code intelligence.
973- Setting: `enable_language_server`
974- Default: `true`
975
976**Options**
977
978`boolean` values
979
980## Ensure Final Newline On Save
981
982- Description: Removes any lines containing only whitespace at the end of the file and ensures just one newline at the end.
983- Setting: `ensure_final_newline_on_save`
984- Default: `true`
985
986**Options**
987
988`boolean` values
989
990## LSP
991
992- Description: Configuration for language servers.
993- Setting: `lsp`
994- Default: `null`
995
996**Options**
997
998The following settings can be overridden for specific language servers:
999
1000- `initialization_options`
1001- `settings`
1002
1003To override configuration for a language server, add an entry for that language server's name to the `lsp` value.
1004
1005Some options are passed via `initialization_options` to the language server. These are for options which must be specified at language server startup and when changed will require restarting the language server.
1006
1007For example to pass the `check` option to `rust-analyzer`, use the following configuration:
1008
1009```json
1010"lsp": {
1011 "rust-analyzer": {
1012 "initialization_options": {
1013 "check": {
1014 "command": "clippy" // rust-analyzer.check.command (default: "check")
1015 }
1016 }
1017 }
1018}
1019```
1020
1021While other options may be changed at a runtime and should be placed under `settings`:
1022
1023```json
1024"lsp": {
1025 "yaml-language-server": {
1026 "settings": {
1027 "yaml": {
1028 "keyOrdering": true // Enforces alphabetical ordering of keys in maps
1029 }
1030 }
1031 }
1032}
1033```
1034
1035## LSP Highlight Debounce
1036
1037- Description: The debounce delay in milliseconds before querying highlights from the language server based on the current cursor location.
1038- Setting: `lsp_highlight_debounce`
1039- Default: `75`
1040
1041**Options**
1042
1043`integer` values representing milliseconds
1044
1045## Format On Save
1046
1047- Description: Whether or not to perform a buffer format before saving.
1048- Setting: `format_on_save`
1049- Default: `on`
1050
1051**Options**
1052
10531. `on`, enables format on save obeying `formatter` setting:
1054
1055```json
1056{
1057 "format_on_save": "on"
1058}
1059```
1060
10612. `off`, disables format on save:
1062
1063```json
1064{
1065 "format_on_save": "off"
1066}
1067```
1068
1069## Formatter
1070
1071- Description: How to perform a buffer format.
1072- Setting: `formatter`
1073- Default: `auto`
1074
1075**Options**
1076
10771. To use the current language server, use `"language_server"`:
1078
1079```json
1080{
1081 "formatter": "language_server"
1082}
1083```
1084
10852. Or to use an external command, use `"external"`. Specify the name of the formatting program to run, and an array of arguments to pass to the program. The buffer's text will be passed to the program on stdin, and the formatted output should be written to stdout. For example, the following command would strip trailing spaces using [`sed(1)`](https://linux.die.net/man/1/sed):
1086
1087```json
1088{
1089 "formatter": {
1090 "external": {
1091 "command": "sed",
1092 "arguments": ["-e", "s/ *$//"]
1093 }
1094 }
1095}
1096```
1097
10983. External formatters may optionally include a `{buffer_path}` placeholder which at runtime will include the path of the buffer being formatted. Formatters operate by receiving file content via standard input, reformatting it and then outputting it to standard output and so normally don't know the filename of what they are formatting. Tools like prettier support receiving the file path via a command line argument which can then used to impact formatting decisions.
1099
1100WARNING: `{buffer_path}` should not be used to direct your formatter to read from a filename. Your formatter should only read from standard input and should not read or write files directly.
1101
1102```json
1103 "formatter": {
1104 "external": {
1105 "command": "prettier",
1106 "arguments": ["--stdin-filepath", "{buffer_path}"]
1107 }
1108 }
1109```
1110
11114. Or to use code actions provided by the connected language servers, use `"code_actions"`:
1112
1113```json
1114{
1115 "formatter": {
1116 "code_actions": {
1117 // Use ESLint's --fix:
1118 "source.fixAll.eslint": true,
1119 // Organize imports on save:
1120 "source.organizeImports": true
1121 }
1122 }
1123}
1124```
1125
11265. Or to use multiple formatters consecutively, use an array of formatters:
1127
1128```json
1129{
1130 "formatter": [
1131 { "language_server": { "name": "rust-analyzer" } },
1132 {
1133 "external": {
1134 "command": "sed",
1135 "arguments": ["-e", "s/ *$//"]
1136 }
1137 }
1138 ]
1139}
1140```
1141
1142Here `rust-analyzer` will be used first to format the code, followed by a call of sed.
1143If any of the formatters fails, the subsequent ones will still be executed.
1144
1145## Code Actions On Format
1146
1147- Description: The code actions to perform with the primary language server when formatting the buffer.
1148- Setting: `code_actions_on_format`
1149- Default: `{}`, except for Go it's `{ "source.organizeImports": true }`
1150
1151**Examples**
1152
1153<!--
1154TBD: Add Python Ruff source.organizeImports example
1155-->
1156
11571. Organize imports on format in TypeScript and TSX buffers:
1158
1159```json
1160{
1161 "languages": {
1162 "TypeScript": {
1163 "code_actions_on_format": {
1164 "source.organizeImports": true
1165 }
1166 },
1167 "TSX": {
1168 "code_actions_on_format": {
1169 "source.organizeImports": true
1170 }
1171 }
1172 }
1173}
1174```
1175
11762. Run ESLint `fixAll` code action when formatting:
1177
1178```json
1179{
1180 "languages": {
1181 "JavaScript": {
1182 "code_actions_on_format": {
1183 "source.fixAll.eslint": true
1184 }
1185 }
1186 }
1187}
1188```
1189
11903. Run only a single ESLint rule when using `fixAll`:
1191
1192```json
1193{
1194 "languages": {
1195 "JavaScript": {
1196 "code_actions_on_format": {
1197 "source.fixAll.eslint": true
1198 }
1199 }
1200 },
1201 "lsp": {
1202 "eslint": {
1203 "settings": {
1204 "codeActionOnSave": {
1205 "rules": ["import/order"]
1206 }
1207 }
1208 }
1209 }
1210}
1211```
1212
1213## Auto close
1214
1215- Description: Whether to automatically add matching closing characters when typing opening parenthesis, bracket, brace, single or double quote characters.
1216- Setting: `use_autoclose`
1217- Default: `true`
1218
1219**Options**
1220
1221`boolean` values
1222
1223## Always Treat Brackets As Autoclosed
1224
1225- Description: Controls how the editor handles the autoclosed characters.
1226- Setting: `always_treat_brackets_as_autoclosed`
1227- Default: `false`
1228
1229**Options**
1230
1231`boolean` values
1232
1233**Example**
1234
1235If the setting is set to `true`:
1236
12371. Enter in the editor: `)))`
12382. Move the cursor to the start: `^)))`
12393. Enter again: `)))`
1240
1241The result is still `)))` and not `))))))`, which is what it would be by default.
1242
1243## File Scan Exclusions
1244
1245- Setting: `file_scan_exclusions`
1246- Description: Files or globs of files that will be excluded by Zed entirely. They will be skipped during file scans, file searches, and not be displayed in the project file tree. Overrides `file_scan_inclusions`.
1247- Default:
1248
1249```json
1250"file_scan_exclusions": [
1251 "**/.git",
1252 "**/.svn",
1253 "**/.hg",
1254 "**/.jj",
1255 "**/CVS",
1256 "**/.DS_Store",
1257 "**/Thumbs.db",
1258 "**/.classpath",
1259 "**/.settings"
1260],
1261```
1262
1263Note, specifying `file_scan_exclusions` in settings.json will override the defaults (shown above). If you are looking to exclude additional items you will need to include all the default values in your settings.
1264
1265## File Scan Inclusions
1266
1267- Setting: `file_scan_inclusions`
1268- Description: Files or globs of files that will be included by Zed, even when ignored by git. This is useful for files that are not tracked by git, but are still important to your project. Note that globs that are overly broad can slow down Zed's file scanning. `file_scan_exclusions` takes precedence over these inclusions.
1269- Default:
1270
1271```json
1272"file_scan_inclusions": [".env*"],
1273```
1274
1275## File Types
1276
1277- Setting: `file_types`
1278- Description: Configure how Zed selects a language for a file based on its filename or extension. Supports glob entries.
1279- Default:
1280
1281```json
1282"file_types": {
1283 "JSONC": ["**/.zed/**/*.json", "**/zed/**/*.json", "**/Zed/**/*.json", "**/.vscode/**/*.json"],
1284 "Shell Script": [".env.*"]
1285}
1286```
1287
1288**Examples**
1289
1290To interpret all `.c` files as C++, files called `MyLockFile` as TOML and files starting with `Dockerfile` as Dockerfile:
1291
1292```json
1293{
1294 "file_types": {
1295 "C++": ["c"],
1296 "TOML": ["MyLockFile"],
1297 "Dockerfile": ["Dockerfile*"]
1298 }
1299}
1300```
1301
1302## Diagnostics
1303
1304- Description: Configuration for diagnostics-related features.
1305- Setting: `diagnostics`
1306- Default:
1307
1308```json
1309{
1310 "diagnostics": {
1311 "include_warnings": true,
1312 "inline": {
1313 "enabled": false
1314 }
1315 "update_with_cursor": false,
1316 "primary_only": false,
1317 "use_rendered": false,
1318 }
1319}
1320```
1321
1322### Inline Diagnostics
1323
1324- Description: Whether or not to show diagnostics information inline.
1325- Setting: `inline`
1326- Default:
1327
1328```json
1329{
1330 "diagnostics": {
1331 "inline": {
1332 "enabled": false,
1333 "update_debounce_ms": 150,
1334 "padding": 4,
1335 "min_column": 0,
1336 "max_severity": null
1337 }
1338 }
1339}
1340```
1341
1342**Options**
1343
13441. Enable inline diagnostics.
1345
1346```json
1347{
1348 "diagnostics": {
1349 "inline": {
1350 "enabled": true
1351 }
1352 }
1353}
1354```
1355
13562. Delay diagnostic updates until some time after the last diagnostic update.
1357
1358```json
1359{
1360 "diagnostics": {
1361 "inline": {
1362 "enabled": true,
1363 "update_debounce_ms": 150
1364 }
1365 }
1366}
1367```
1368
13693. Set padding between the end of the source line and the start of the diagnostic.
1370
1371```json
1372{
1373 "diagnostics": {
1374 "inline": {
1375 "enabled": true,
1376 "padding": 4
1377 }
1378 }
1379}
1380```
1381
13824. Horizontally align inline diagnostics at the given column.
1383
1384```json
1385{
1386 "diagnostics": {
1387 "inline": {
1388 "enabled": true,
1389 "min_column": 80
1390 }
1391 }
1392}
1393```
1394
13955. Show only warning and error diagnostics.
1396
1397```json
1398{
1399 "diagnostics": {
1400 "inline": {
1401 "enabled": true,
1402 "max_severity": "warning"
1403 }
1404 }
1405}
1406```
1407
1408## Git
1409
1410- Description: Configuration for git-related features.
1411- Setting: `git`
1412- Default:
1413
1414```json
1415{
1416 "git": {
1417 "git_gutter": "tracked_files",
1418 "inline_blame": {
1419 "enabled": true
1420 },
1421 "hunk_style": "staged_hollow"
1422 }
1423}
1424```
1425
1426### Git Gutter
1427
1428- Description: Whether or not to show the git gutter.
1429- Setting: `git_gutter`
1430- Default: `tracked_files`
1431
1432**Options**
1433
14341. Show git gutter in tracked files
1435
1436```json
1437{
1438 "git": {
1439 "git_gutter": "tracked_files"
1440 }
1441}
1442```
1443
14442. Hide git gutter
1445
1446```json
1447{
1448 "git": {
1449 "git_gutter": "hide"
1450 }
1451}
1452```
1453
1454### Gutter Debounce
1455
1456- Description: Sets the debounce threshold (in milliseconds) after which changes are reflected in the git gutter.
1457- Setting: `gutter_debounce`
1458- Default: `null`
1459
1460**Options**
1461
1462`integer` values representing milliseconds
1463
1464Example:
1465
1466```json
1467{
1468 "git": {
1469 "gutter_debounce": 100
1470 }
1471}
1472```
1473
1474### Inline Git Blame
1475
1476- Description: Whether or not to show git blame information inline, on the currently focused line.
1477- Setting: `inline_blame`
1478- Default:
1479
1480```json
1481{
1482 "git": {
1483 "inline_blame": {
1484 "enabled": true
1485 }
1486 }
1487}
1488```
1489
1490### Hunk Style
1491
1492- Description: What styling we should use for the diff hunks.
1493- Setting: `hunk_style`
1494- Default:
1495
1496```json
1497{
1498 "git": {
1499 "hunk_style": "staged_hollow"
1500 }
1501}
1502```
1503
1504**Options**
1505
15061. Show the staged hunks faded out and with a border:
1507
1508```json
1509{
1510 "git": {
1511 "hunk_style": "staged_hollow"
1512 }
1513}
1514```
1515
15162. Show unstaged hunks faded out and with a border:
1517
1518```json
1519{
1520 "git": {
1521 "hunk_style": "unstaged_hollow"
1522 }
1523}
1524```
1525
1526**Options**
1527
15281. Disable inline git blame:
1529
1530```json
1531{
1532 "git": {
1533 "inline_blame": {
1534 "enabled": false
1535 }
1536 }
1537}
1538```
1539
15402. Only show inline git blame after a delay (that starts after cursor stops moving):
1541
1542```json
1543{
1544 "git": {
1545 "inline_blame": {
1546 "enabled": true,
1547 "delay_ms": 500
1548 }
1549 }
1550}
1551```
1552
15533. Show a commit summary next to the commit date and author:
1554
1555```json
1556{
1557 "git": {
1558 "inline_blame": {
1559 "enabled": true,
1560 "show_commit_summary": true
1561 }
1562 }
1563}
1564```
1565
15664. Use this as the minimum column at which to display inline blame information:
1567
1568```json
1569{
1570 "git": {
1571 "inline_blame": {
1572 "enabled": true,
1573 "min_column": 80
1574 }
1575 }
1576}
1577```
1578
1579## Indent Guides
1580
1581- Description: Configuration related to indent guides. Indent guides can be configured separately for each language.
1582- Setting: `indent_guides`
1583- Default:
1584
1585```json
1586{
1587 "indent_guides": {
1588 "enabled": true,
1589 "line_width": 1,
1590 "active_line_width": 1,
1591 "coloring": "fixed",
1592 "background_coloring": "disabled"
1593 }
1594}
1595```
1596
1597**Options**
1598
15991. Disable indent guides
1600
1601```json
1602{
1603 "indent_guides": {
1604 "enabled": false
1605 }
1606}
1607```
1608
16092. Enable indent guides for a specific language.
1610
1611```json
1612{
1613 "languages": {
1614 "Python": {
1615 "indent_guides": {
1616 "enabled": true
1617 }
1618 }
1619 }
1620}
1621```
1622
16233. Enable indent aware coloring ("rainbow indentation").
1624 The colors that are used for different indentation levels are defined in the theme (theme key: `accents`). They can be customized by using theme overrides.
1625
1626```json
1627{
1628 "indent_guides": {
1629 "enabled": true,
1630 "coloring": "indent_aware"
1631 }
1632}
1633```
1634
16354. Enable indent aware background coloring ("rainbow indentation").
1636 The colors that are used for different indentation levels are defined in the theme (theme key: `accents`). They can be customized by using theme overrides.
1637
1638```json
1639{
1640 "indent_guides": {
1641 "enabled": true,
1642 "coloring": "indent_aware",
1643 "background_coloring": "indent_aware"
1644 }
1645}
1646```
1647
1648## Hard Tabs
1649
1650- Description: Whether to indent lines using tab characters or multiple spaces.
1651- Setting: `hard_tabs`
1652- Default: `false`
1653
1654**Options**
1655
1656`boolean` values
1657
1658## Hover Popover Enabled
1659
1660- Description: Whether or not to show the informational hover box when moving the mouse over symbols in the editor.
1661- Setting: `hover_popover_enabled`
1662- Default: `true`
1663
1664**Options**
1665
1666`boolean` values
1667
1668## Icon Theme
1669
1670- Description: The icon theme setting can be specified in two forms - either as the name of an icon theme or as an object containing the `mode`, `dark`, and `light` icon themes for files/folders inside Zed.
1671- Setting: `icon_theme`
1672- Default: `Zed (Default)`
1673
1674### Icon Theme Object
1675
1676- Description: Specify the icon theme using an object that includes the `mode`, `dark`, and `light`.
1677- Setting: `icon_theme`
1678- Default:
1679
1680```json
1681"icon_theme": {
1682 "mode": "system",
1683 "dark": "Zed (Default)",
1684 "light": "Zed (Default)"
1685},
1686```
1687
1688### Mode
1689
1690- Description: Specify the icon theme mode.
1691- Setting: `mode`
1692- Default: `system`
1693
1694**Options**
1695
16961. Set the icon theme to dark mode
1697
1698```json
1699{
1700 "mode": "dark"
1701}
1702```
1703
17042. Set the icon theme to light mode
1705
1706```json
1707{
1708 "mode": "light"
1709}
1710```
1711
17123. Set the icon theme to system mode
1713
1714```json
1715{
1716 "mode": "system"
1717}
1718```
1719
1720### Dark
1721
1722- Description: The name of the dark icon theme.
1723- Setting: `dark`
1724- Default: `Zed (Default)`
1725
1726**Options**
1727
1728Run the `icon theme selector: toggle` action in the command palette to see a current list of valid icon themes names.
1729
1730### Light
1731
1732- Description: The name of the light icon theme.
1733- Setting: `light`
1734- Default: `Zed (Default)`
1735
1736**Options**
1737
1738Run the `icon theme selector: toggle` action in the command palette to see a current list of valid icon themes names.
1739
1740## Inlay hints
1741
1742- Description: Configuration for displaying extra text with hints in the editor.
1743- Setting: `inlay_hints`
1744- Default:
1745
1746```json
1747"inlay_hints": {
1748 "enabled": false,
1749 "show_type_hints": true,
1750 "show_parameter_hints": true,
1751 "show_other_hints": true,
1752 "show_background": false,
1753 "edit_debounce_ms": 700,
1754 "scroll_debounce_ms": 50,
1755 "toggle_on_modifiers_press": null
1756}
1757```
1758
1759**Options**
1760
1761Inlay hints querying consists of two parts: editor (client) and LSP server.
1762With the inlay settings above are changed to enable the hints, editor will start to query certain types of hints and react on LSP hint refresh request from the server.
1763At this point, the server may or may not return hints depending on its implementation, further configuration might be needed, refer to the corresponding LSP server documentation.
1764
1765The following languages have inlay hints preconfigured by Zed:
1766
1767- [Go](https://docs.zed.dev/languages/go)
1768- [Rust](https://docs.zed.dev/languages/rust)
1769- [Svelte](https://docs.zed.dev/languages/svelte)
1770- [Typescript](https://docs.zed.dev/languages/typescript)
1771
1772Use the `lsp` section for the server configuration. Examples are provided in the corresponding language documentation.
1773
1774Hints are not instantly queried in Zed, two kinds of debounces are used, either may be set to 0 to be disabled.
1775Settings-related hint updates are not debounced.
1776
1777All possible config values for `toggle_on_modifiers_press` are:
1778
1779```json
1780"inlay_hints": {
1781 "toggle_on_modifiers_press": {
1782 "control": true,
1783 "shift": true,
1784 "alt": true,
1785 "platform": true,
1786 "function": true
1787 }
1788}
1789```
1790
1791Unspecified values have a `false` value, hints won't be toggled if all the modifiers are `false` or not all the modifiers are pressed.
1792
1793## Journal
1794
1795- Description: Configuration for the journal.
1796- Setting: `journal`
1797- Default:
1798
1799```json
1800"journal": {
1801 "path": "~",
1802 "hour_format": "hour12"
1803}
1804```
1805
1806### Path
1807
1808- Description: The path of the directory where journal entries are stored.
1809- Setting: `path`
1810- Default: `~`
1811
1812**Options**
1813
1814`string` values
1815
1816### Hour Format
1817
1818- Description: The format to use for displaying hours in the journal.
1819- Setting: `hour_format`
1820- Default: `hour12`
1821
1822**Options**
1823
18241. 12-hour format:
1825
1826```json
1827{
1828 "hour_format": "hour12"
1829}
1830```
1831
18322. 24-hour format:
1833
1834```json
1835{
1836 "hour_format": "hour24"
1837}
1838```
1839
1840## Languages
1841
1842- Description: Configuration for specific languages.
1843- Setting: `languages`
1844- Default: `null`
1845
1846**Options**
1847
1848To override settings for a language, add an entry for that languages name to the `languages` value. Example:
1849
1850```json
1851"languages": {
1852 "C": {
1853 "format_on_save": "off",
1854 "preferred_line_length": 64,
1855 "soft_wrap": "preferred_line_length"
1856 },
1857 "JSON": {
1858 "tab_size": 4
1859 }
1860}
1861```
1862
1863The following settings can be overridden for each specific language:
1864
1865- [`enable_language_server`](#enable-language-server)
1866- [`ensure_final_newline_on_save`](#ensure-final-newline-on-save)
1867- [`format_on_save`](#format-on-save)
1868- [`formatter`](#formatter)
1869- [`hard_tabs`](#hard-tabs)
1870- [`preferred_line_length`](#preferred-line-length)
1871- [`remove_trailing_whitespace_on_save`](#remove-trailing-whitespace-on-save)
1872- [`show_edit_predictions`](#show-edit-predictions)
1873- [`show_whitespaces`](#show-whitespaces)
1874- [`soft_wrap`](#soft-wrap)
1875- [`tab_size`](#tab-size)
1876- [`use_autoclose`](#use-autoclose)
1877- [`always_treat_brackets_as_autoclosed`](#always-treat-brackets-as-autoclosed)
1878
1879These values take in the same options as the root-level settings with the same name.
1880
1881## Network Proxy
1882
1883- Description: Configure a network proxy for Zed.
1884- Setting: `proxy`
1885- Default: `null`
1886
1887**Options**
1888
1889The proxy setting must contain a URL to the proxy.
1890
1891The following URI schemes are supported:
1892
1893- `http`
1894- `https`
1895- `socks4` - SOCKS4 proxy with local DNS
1896- `socks4a` - SOCKS4 proxy with remote DNS
1897- `socks5` - SOCKS5 proxy with local DNS
1898- `socks5h` - SOCKS5 proxy with remote DNS
1899
1900`http` will be used when no scheme is specified.
1901
1902By default no proxy will be used, or Zed will attempt to retrieve proxy settings from environment variables, such as `http_proxy`, `HTTP_PROXY`, `https_proxy`, `HTTPS_PROXY`, `all_proxy`, `ALL_PROXY`.
1903
1904For example, to set an `http` proxy, add the following to your settings:
1905
1906```json
1907{
1908 "proxy": "http://127.0.0.1:10809"
1909}
1910```
1911
1912Or to set a `socks5` proxy:
1913
1914```json
1915{
1916 "proxy": "socks5h://localhost:10808"
1917}
1918```
1919
1920## Preview tabs
1921
1922- Description:
1923 Preview tabs allow you to open files in preview mode, where they close automatically when you switch to another file unless you explicitly pin them. This is useful for quickly viewing files without cluttering your workspace. Preview tabs display their file names in italics. \
1924 There are several ways to convert a preview tab into a regular tab:
1925
1926 - Double-clicking on the file
1927 - Double-clicking on the tab header
1928 - Using the `project_panel::OpenPermanent` action
1929 - Editing the file
1930 - Dragging the file to a different pane
1931
1932- Setting: `preview_tabs`
1933- Default:
1934
1935```json
1936"preview_tabs": {
1937 "enabled": true,
1938 "enable_preview_from_file_finder": false,
1939 "enable_preview_from_code_navigation": false,
1940}
1941```
1942
1943### Enable preview from file finder
1944
1945- Description: Determines whether to open files in preview mode when selected from the file finder.
1946- Setting: `enable_preview_from_file_finder`
1947- Default: `false`
1948
1949**Options**
1950
1951`boolean` values
1952
1953### Enable preview from code navigation
1954
1955- Description: Determines whether a preview tab gets replaced when code navigation is used to navigate away from the tab.
1956- Setting: `enable_preview_from_code_navigation`
1957- Default: `false`
1958
1959**Options**
1960
1961`boolean` values
1962
1963## File Finder
1964
1965### Modal Max Width
1966
1967- Description: Max-width of the file finder modal. It can take one of these values: `small`, `medium`, `large`, `xlarge`, and `full`.
1968- Setting: `modal_max_width`
1969- Default: `small`
1970
1971## Preferred Line Length
1972
1973- Description: The column at which to soft-wrap lines, for buffers where soft-wrap is enabled.
1974- Setting: `preferred_line_length`
1975- Default: `80`
1976
1977**Options**
1978
1979`integer` values
1980
1981## Projects Online By Default
1982
1983- Description: Whether or not to show the online projects view by default.
1984- Setting: `projects_online_by_default`
1985- Default: `true`
1986
1987**Options**
1988
1989`boolean` values
1990
1991## Remove Trailing Whitespace On Save
1992
1993- Description: Whether or not to remove any trailing whitespace from lines of a buffer before saving it.
1994- Setting: `remove_trailing_whitespace_on_save`
1995- Default: `true`
1996
1997**Options**
1998
1999`boolean` values
2000
2001## Search
2002
2003- Description: Search options to enable by default when opening new project and buffer searches.
2004- Setting: `search`
2005- Default:
2006
2007```json
2008"search": {
2009 "whole_word": false,
2010 "case_sensitive": false,
2011 "include_ignored": false,
2012 "regex": false
2013},
2014```
2015
2016## Seed Search Query From Cursor
2017
2018- Description: When to populate a new search's query based on the text under the cursor.
2019- Setting: `seed_search_query_from_cursor`
2020- Default: `always`
2021
2022**Options**
2023
20241. `always` always populate the search query with the word under the cursor
20252. `selection` only populate the search query when there is text selected
20263. `never` never populate the search query
2027
2028## Use Smartcase Search
2029
2030- Description: When enabled, automatically adjusts search case sensitivity based on your query. If your search query contains any uppercase letters, the search becomes case-sensitive; if it contains only lowercase letters, the search becomes case-insensitive. \
2031 This applies to both in-file searches and project-wide searches.
2032- Setting: `use_smartcase_search`
2033- Default: `false`
2034
2035**Options**
2036
2037`boolean` values
2038
2039Examples:
2040
2041- Searching for "function" would match "function", "Function", "FUNCTION", etc.
2042- Searching for "Function" would only match "Function", not "function" or "FUNCTION"
2043
2044## Show Call Status Icon
2045
2046- Description: Whether or not to show the call status icon in the status bar.
2047- Setting: `show_call_status_icon`
2048- Default: `true`
2049
2050**Options**
2051
2052`boolean` values
2053
2054## Show Completions On Input
2055
2056- Description: Whether or not to show completions as you type.
2057- Setting: `show_completions_on_input`
2058- Default: `true`
2059
2060**Options**
2061
2062`boolean` values
2063
2064## Show Completion Documentation
2065
2066- Description: Whether to display inline and alongside documentation for items in the completions menu.
2067- Setting: `show_completion_documentation`
2068- Default: `true`
2069
2070**Options**
2071
2072`boolean` values
2073
2074## Show Edit Predictions
2075
2076- Description: Whether to show edit predictions as you type or manually by triggering `editor::ShowEditPrediction`.
2077- Setting: `show_edit_predictions`
2078- Default: `true`
2079
2080**Options**
2081
2082`boolean` values
2083
2084## Show Whitespaces
2085
2086- Description: Whether or not to show render whitespace characters in the editor.
2087- Setting: `show_whitespaces`
2088- Default: `selection`
2089
2090**Options**
2091
20921. `all`
20932. `selection`
20943. `none`
20954. `boundary`
2096
2097## Soft Wrap
2098
2099- Description: Whether or not to automatically wrap lines of text to fit editor / preferred width.
2100- Setting: `soft_wrap`
2101- Default: `none`
2102
2103**Options**
2104
21051. `none` to avoid wrapping generally, unless the line is too long
21062. `prefer_line` (deprecated, same as `none`)
21073. `editor_width` to wrap lines that overflow the editor width
21084. `preferred_line_length` to wrap lines that overflow `preferred_line_length` config value
21095. `bounded` to wrap lines at the minimum of `editor_width` and `preferred_line_length`
2110
2111## Wrap Guides (Vertical Rulers)
2112
2113- Description: Where to display vertical rulers as wrap-guides. Disable by setting `show_wrap_guides` to `false`.
2114- Setting: `wrap_guides`
2115- Default: []
2116
2117**Options**
2118
2119List of `integer` column numbers
2120
2121## Tab Size
2122
2123- Description: The number of spaces to use for each tab character.
2124- Setting: `tab_size`
2125- Default: `4`
2126
2127**Options**
2128
2129`integer` values
2130
2131## Telemetry
2132
2133- Description: Control what info is collected by Zed.
2134- Setting: `telemetry`
2135- Default:
2136
2137```json
2138"telemetry": {
2139 "diagnostics": true,
2140 "metrics": true
2141},
2142```
2143
2144**Options**
2145
2146### Diagnostics
2147
2148- Description: Setting for sending debug-related data, such as crash reports.
2149- Setting: `diagnostics`
2150- Default: `true`
2151
2152**Options**
2153
2154`boolean` values
2155
2156### Metrics
2157
2158- Description: Setting for sending anonymized usage data, such what languages you're using Zed with.
2159- Setting: `metrics`
2160- Default: `true`
2161
2162**Options**
2163
2164`boolean` values
2165
2166## Terminal
2167
2168- Description: Configuration for the terminal.
2169- Setting: `terminal`
2170- Default:
2171
2172```json
2173{
2174 "terminal": {
2175 "alternate_scroll": "off",
2176 "blinking": "terminal_controlled",
2177 "copy_on_select": false,
2178 "dock": "bottom",
2179 "default_width": 640,
2180 "default_height": 320,
2181 "detect_venv": {
2182 "on": {
2183 "directories": [".env", "env", ".venv", "venv"],
2184 "activate_script": "default"
2185 }
2186 },
2187 "env": {},
2188 "font_family": null,
2189 "font_features": null,
2190 "font_size": null,
2191 "line_height": "comfortable",
2192 "option_as_meta": false,
2193 "button": true,
2194 "shell": "system",
2195 "toolbar": {
2196 "breadcrumbs": true
2197 },
2198 "working_directory": "current_project_directory",
2199 "scrollbar": {
2200 "show": null
2201 }
2202 }
2203}
2204```
2205
2206### Terminal: Dock
2207
2208- Description: Control the position of the dock
2209- Setting: `dock`
2210- Default: `bottom`
2211
2212**Options**
2213
2214`"bottom"`, `"left"` or `"right"`
2215
2216### Terminal: Alternate Scroll
2217
2218- Description: Set whether Alternate Scroll mode (DECSET code: `?1007`) is active by default. Alternate Scroll mode converts mouse scroll events into up / down key presses when in the alternate screen (e.g. when running applications like vim or less). The terminal can still set and unset this mode with ANSI escape codes.
2219- Setting: `alternate_scroll`
2220- Default: `off`
2221
2222**Options**
2223
22241. Default alternate scroll mode to off
2225
2226```json
2227{
2228 "terminal": {
2229 "alternate_scroll": "off"
2230 }
2231}
2232```
2233
22342. Default alternate scroll mode to on
2235
2236```json
2237{
2238 "terminal": {
2239 "alternate_scroll": "on"
2240 }
2241}
2242```
2243
2244### Terminal: Blinking
2245
2246- Description: Set the cursor blinking behavior in the terminal
2247- Setting: `blinking`
2248- Default: `terminal_controlled`
2249
2250**Options**
2251
22521. Never blink the cursor, ignore the terminal mode
2253
2254```json
2255{
2256 "terminal": {
2257 "blinking": "off"
2258 }
2259}
2260```
2261
22622. Default the cursor blink to off, but allow the terminal to turn blinking on
2263
2264```json
2265{
2266 "terminal": {
2267 "blinking": "terminal_controlled"
2268 }
2269}
2270```
2271
22723. Always blink the cursor, ignore the terminal mode
2273
2274```json
2275{
2276 "terminal": {
2277 "blinking": "on"
2278 }
2279}
2280```
2281
2282### Terminal: Copy On Select
2283
2284- Description: Whether or not selecting text in the terminal will automatically copy to the system clipboard.
2285- Setting: `copy_on_select`
2286- Default: `false`
2287
2288**Options**
2289
2290`boolean` values
2291
2292**Example**
2293
2294```json
2295{
2296 "terminal": {
2297 "copy_on_select": true
2298 }
2299}
2300```
2301
2302### Terminal: Env
2303
2304- Description: Any key-value pairs added to this object will be added to the terminal's environment. Keys must be unique, use `:` to separate multiple values in a single variable
2305- Setting: `env`
2306- Default: `{}`
2307
2308**Example**
2309
2310```json
2311{
2312 "terminal": {
2313 "env": {
2314 "ZED": "1",
2315 "KEY": "value1:value2"
2316 }
2317 }
2318}
2319```
2320
2321### Terminal: Font Size
2322
2323- Description: What font size to use for the terminal. When not set defaults to matching the editor's font size
2324- Setting: `font_size`
2325- Default: `null`
2326
2327**Options**
2328
2329`integer` values
2330
2331```json
2332{
2333 "terminal": {
2334 "font_size": 15
2335 }
2336}
2337```
2338
2339### Terminal: Font Family
2340
2341- Description: What font to use for the terminal. When not set, defaults to matching the editor's font.
2342- Setting: `font_family`
2343- Default: `null`
2344
2345**Options**
2346
2347The name of any font family installed on the user's system
2348
2349```json
2350{
2351 "terminal": {
2352 "font_family": "Berkeley Mono"
2353 }
2354}
2355```
2356
2357### Terminal: Font Features
2358
2359- Description: What font features to use for the terminal. When not set, defaults to matching the editor's font features.
2360- Setting: `font_features`
2361- Default: `null`
2362- Platform: macOS and Windows.
2363
2364**Options**
2365
2366See Buffer Font Features
2367
2368```json
2369{
2370 "terminal": {
2371 "font_features": {
2372 "calt": false
2373 // See Buffer Font Features for more features
2374 }
2375 }
2376}
2377```
2378
2379### Terminal: Line Height
2380
2381- Description: Set the terminal's line height.
2382- Setting: `line_height`
2383- Default: `comfortable`
2384
2385**Options**
2386
23871. Use a line height that's `comfortable` for reading, 1.618. (default)
2388
2389```json
2390{
2391 "terminal": {
2392 "line_height": "comfortable"
2393 }
2394}
2395```
2396
23972. Use a `standard` line height, 1.3. This option is useful for TUIs, particularly if they use box characters
2398
2399```json
2400{
2401 "terminal": {
2402 "line_height": "standard"
2403 }
2404}
2405```
2406
24073. Use a custom line height.
2408
2409```json
2410{
2411 "terminal": {
2412 "line_height": {
2413 "custom": 2
2414 }
2415 }
2416}
2417```
2418
2419### Terminal: Option As Meta
2420
2421- Description: Re-interprets the option keys to act like a 'meta' key, like in Emacs.
2422- Setting: `option_as_meta`
2423- Default: `false`
2424
2425**Options**
2426
2427`boolean` values
2428
2429```json
2430{
2431 "terminal": {
2432 "option_as_meta": true
2433 }
2434}
2435```
2436
2437### Terminal: Shell
2438
2439- Description: What shell to use when launching the terminal.
2440- Setting: `shell`
2441- Default: `system`
2442
2443**Options**
2444
24451. Use the system's default terminal configuration (usually the `/etc/passwd` file).
2446
2447```json
2448{
2449 "terminal": {
2450 "shell": "system"
2451 }
2452}
2453```
2454
24552. A program to launch:
2456
2457```json
2458{
2459 "terminal": {
2460 "shell": {
2461 "program": "sh"
2462 }
2463 }
2464}
2465```
2466
24673. A program with arguments:
2468
2469```json
2470{
2471 "terminal": {
2472 "shell": {
2473 "with_arguments": {
2474 "program": "/bin/bash",
2475 "args": ["--login"]
2476 }
2477 }
2478 }
2479}
2480```
2481
2482## Terminal: Detect Virtual Environments {#terminal-detect_venv}
2483
2484- Description: Activate the [Python Virtual Environment](https://docs.python.org/3/library/venv.html), if one is found, in the terminal's working directory (as resolved by the working_directory and automatically activating the virtual environment.
2485- Setting: `detect_venv`
2486- Default:
2487
2488```json
2489{
2490 "terminal": {
2491 "detect_venv": {
2492 "on": {
2493 // Default directories to search for virtual environments, relative
2494 // to the current working directory. We recommend overriding this
2495 // in your project's settings, rather than globally.
2496 "directories": [".env", "env", ".venv", "venv"],
2497 // Can also be `csh`, `fish`, and `nushell`
2498 "activate_script": "default"
2499 }
2500 }
2501 }
2502}
2503```
2504
2505Disable with:
2506
2507```json
2508{
2509 "terminal": {
2510 "detect_venv": "off"
2511 }
2512}
2513```
2514
2515## Terminal: Toolbar
2516
2517- Description: Whether or not to show various elements in the terminal toolbar.
2518- Setting: `toolbar`
2519- Default:
2520
2521```json
2522{
2523 "terminal": {
2524 "toolbar": {
2525 "breadcrumbs": true
2526 }
2527 }
2528}
2529```
2530
2531**Options**
2532
2533At the moment, only the `breadcrumbs` option is available, it controls displaying of the terminal title that can be changed via `PROMPT_COMMAND`.
2534
2535If the terminal title is empty, the breadcrumbs won't be shown.
2536
2537The shell running in the terminal needs to be configured to emit the title.
2538
2539Example command to set the title: `echo -e "\e]2;New Title\007";`
2540
2541### Terminal: Button
2542
2543- Description: Control to show or hide the terminal button in the status bar
2544- Setting: `button`
2545- Default: `true`
2546
2547**Options**
2548
2549`boolean` values
2550
2551```json
2552{
2553 "terminal": {
2554 "button": false
2555 }
2556}
2557```
2558
2559### Terminal: Working Directory
2560
2561- Description: What working directory to use when launching the terminal.
2562- Setting: `working_directory`
2563- Default: `"current_project_directory"`
2564
2565**Options**
2566
25671. Use the current file's project directory. Will Fallback to the first project directory strategy if unsuccessful
2568
2569```json
2570{
2571 "terminal": {
2572 "working_directory": "current_project_directory"
2573 }
2574}
2575```
2576
25772. Use the first project in this workspace's directory. Will fallback to using this platform's home directory.
2578
2579```json
2580{
2581 "terminal": {
2582 "working_directory": "first_project_directory"
2583 }
2584}
2585```
2586
25873. Always use this platform's home directory (if we can find it)
2588
2589```json
2590{
2591 "terminal": {
2592 "working_directory": "always_home"
2593 }
2594}
2595```
2596
25974. Always use a specific directory. This value will be shell expanded. If this path is not a valid directory the terminal will default to this platform's home directory.
2598
2599```json
2600{
2601 "terminal": {
2602 "working_directory": {
2603 "always": {
2604 "directory": "~/zed/projects/"
2605 }
2606 }
2607 }
2608}
2609```
2610
2611## Theme
2612
2613- Description: The theme setting can be specified in two forms - either as the name of a theme or as an object containing the `mode`, `dark`, and `light` themes for the Zed UI.
2614- Setting: `theme`
2615- Default: `One Dark`
2616
2617### Theme Object
2618
2619- Description: Specify the theme using an object that includes the `mode`, `dark`, and `light` themes.
2620- Setting: `theme`
2621- Default:
2622
2623```json
2624"theme": {
2625 "mode": "system",
2626 "dark": "One Dark",
2627 "light": "One Light"
2628},
2629```
2630
2631### Mode
2632
2633- Description: Specify theme mode.
2634- Setting: `mode`
2635- Default: `system`
2636
2637**Options**
2638
26391. Set the theme to dark mode
2640
2641```json
2642{
2643 "mode": "dark"
2644}
2645```
2646
26472. Set the theme to light mode
2648
2649```json
2650{
2651 "mode": "light"
2652}
2653```
2654
26553. Set the theme to system mode
2656
2657```json
2658{
2659 "mode": "system"
2660}
2661```
2662
2663### Dark
2664
2665- Description: The name of the dark Zed theme to use for the UI.
2666- Setting: `dark`
2667- Default: `One Dark`
2668
2669**Options**
2670
2671Run the `theme selector: toggle` action in the command palette to see a current list of valid themes names.
2672
2673### Light
2674
2675- Description: The name of the light Zed theme to use for the UI.
2676- Setting: `light`
2677- Default: `One Light`
2678
2679**Options**
2680
2681Run the `theme selector: toggle` action in the command palette to see a current list of valid themes names.
2682
2683## Vim
2684
2685- Description: Whether or not to enable vim mode (work in progress).
2686- Setting: `vim_mode`
2687- Default: `false`
2688
2689## Project Panel
2690
2691- Description: Customize project panel
2692- Setting: `project_panel`
2693- Default:
2694
2695```json
2696{
2697 "project_panel": {
2698 "button": true,
2699 "default_width": 240,
2700 "dock": "left",
2701 "entry_spacing": "comfortable",
2702 "file_icons": true,
2703 "folder_icons": true,
2704 "git_status": true,
2705 "indent_size": 20,
2706 "auto_reveal_entries": true,
2707 "auto_fold_dirs": true,
2708 "scrollbar": {
2709 "show": null
2710 },
2711 "show_diagnostics": "all",
2712 "indent_guides": {
2713 "show": "always"
2714 }
2715 }
2716}
2717```
2718
2719### Dock
2720
2721- Description: Control the position of the dock
2722- Setting: `dock`
2723- Default: `left`
2724
2725**Options**
2726
27271. Default dock position to left
2728
2729```json
2730{
2731 "dock": "left"
2732}
2733```
2734
27352. Default dock position to right
2736
2737```json
2738{
2739 "dock": "right"
2740}
2741```
2742
2743### Entry Spacing
2744
2745- Description: Spacing between worktree entries
2746- Setting: `entry_spacing`
2747- Default: `comfortable`
2748
2749**Options**
2750
27511. Comfortable entry spacing
2752
2753```json
2754{
2755 "entry_spacing": "comfortable"
2756}
2757```
2758
27592. Standard entry spacing
2760
2761```json
2762{
2763 "entry_spacing": "standard"
2764}
2765```
2766
2767### Git Status
2768
2769- Description: Indicates newly created and updated files
2770- Setting: `git_status`
2771- Default: `true`
2772
2773**Options**
2774
27751. Default enable git status
2776
2777```json
2778{
2779 "git_status": true
2780}
2781```
2782
27832. Default disable git status
2784
2785```json
2786{
2787 "git_status": false
2788}
2789```
2790
2791### Default Width
2792
2793- Description: Customize default width taken by project panel
2794- Setting: `default_width`
2795- Default: `240`
2796
2797**Options**
2798
2799`float` values
2800
2801### Auto Reveal Entries
2802
2803- Description: Whether to reveal it in the project panel automatically, when a corresponding project entry becomes active. Gitignored entries are never auto revealed.
2804- Setting: `auto_reveal_entries`
2805- Default: `true`
2806
2807**Options**
2808
28091. Enable auto reveal entries
2810
2811```json
2812{
2813 "auto_reveal_entries": true
2814}
2815```
2816
28172. Disable auto reveal entries
2818
2819```json
2820{
2821 "auto_reveal_entries": false
2822}
2823```
2824
2825### Auto Fold Dirs
2826
2827- Description: Whether to fold directories automatically when directory has only one directory inside.
2828- Setting: `auto_fold_dirs`
2829- Default: `true`
2830
2831**Options**
2832
28331. Enable auto fold dirs
2834
2835```json
2836{
2837 "auto_fold_dirs": true
2838}
2839```
2840
28412. Disable auto fold dirs
2842
2843```json
2844{
2845 "auto_fold_dirs": false
2846}
2847```
2848
2849### Indent Size
2850
2851- Description: Amount of indentation (in pixels) for nested items.
2852- Setting: `indent_size`
2853- Default: `20`
2854
2855### Indent Guides: Show
2856
2857- Description: Whether to show indent guides in the project panel.
2858- Setting: `indent_guides`
2859- Default:
2860
2861```json
2862"indent_guides": {
2863 "show": "always"
2864}
2865```
2866
2867**Options**
2868
28691. Show indent guides in the project panel
2870
2871```json
2872{
2873 "indent_guides": {
2874 "show": "always"
2875 }
2876}
2877```
2878
28792. Hide indent guides in the project panel
2880
2881```json
2882{
2883 "indent_guides": {
2884 "show": "never"
2885 }
2886}
2887```
2888
2889### Scrollbar: Show
2890
2891- Description: Whether to show a scrollbar in the project panel. Possible values: null, "auto", "system", "always", "never". Inherits editor settings when absent, see its description for more details.
2892- Setting: `scrollbar`
2893- Default:
2894
2895```json
2896"scrollbar": {
2897 "show": null
2898}
2899```
2900
2901**Options**
2902
29031. Show scrollbar in the project panel
2904
2905```json
2906{
2907 "scrollbar": {
2908 "show": "always"
2909 }
2910}
2911```
2912
29132. Hide scrollbar in the project panel
2914
2915```json
2916{
2917 "scrollbar": {
2918 "show": "never"
2919 }
2920}
2921```
2922
2923## Assistant Panel
2924
2925- Description: Customize assistant panel
2926- Setting: `assistant`
2927- Default:
2928
2929```json
2930"assistant": {
2931 "version": "2",
2932 "enabled": true,
2933 "button": true,
2934 "dock": "right",
2935 "default_width": 640,
2936 "default_height": 320,
2937 "default_model": {
2938 "provider": "zed.dev",
2939 "model": "claude-3-5-sonnet-latest"
2940 },
2941 "editor_model": {
2942 "provider": "zed.dev",
2943 "model": "claude-3-5-sonnet-latest"
2944 }
2945}
2946```
2947
2948## Outline Panel
2949
2950- Description: Customize outline Panel
2951- Setting: `outline_panel`
2952- Default:
2953
2954```json
2955"outline_panel": {
2956 "button": true,
2957 "default_width": 300,
2958 "dock": "left",
2959 "file_icons": true,
2960 "folder_icons": true,
2961 "git_status": true,
2962 "indent_size": 20,
2963 "auto_reveal_entries": true,
2964 "auto_fold_dirs": true,
2965 "indent_guides": {
2966 "show": "always"
2967 },
2968 "scrollbar": {
2969 "show": null
2970 }
2971}
2972```
2973
2974## Calls
2975
2976- Description: Customize behavior when participating in a call
2977- Setting: `calls`
2978- Default:
2979
2980```json
2981"calls": {
2982 // Join calls with the microphone live by default
2983 "mute_on_join": false,
2984 // Share your project when you are the first to join a channel
2985 "share_on_join": false
2986},
2987```
2988
2989## Unnecessary Code Fade
2990
2991- Description: How much to fade out unused code.
2992- Setting: `unnecessary_code_fade`
2993- Default: `0.3`
2994
2995**Options**
2996
2997Float values between `0.0` and `0.9`, where:
2998
2999- `0.0` means no fading (unused code looks the same as used code)
3000- `0.9` means maximum fading (unused code is very faint but still visible)
3001
3002**Example**
3003
3004```json
3005{
3006 "unnecessary_code_fade": 0.5
3007}
3008```
3009
3010## UI Font Family
3011
3012- Description: The name of the font to use for text in the UI.
3013- Setting: `ui_font_family`
3014- Default: `Zed Plex Sans`
3015
3016**Options**
3017
3018The name of any font family installed on the system.
3019
3020## UI Font Features
3021
3022- Description: The OpenType features to enable for text in the UI.
3023- Setting: `ui_font_features`
3024- Default:
3025
3026```json
3027"ui_font_features": {
3028 "calt": false
3029}
3030```
3031
3032- Platform: macOS and Windows.
3033
3034**Options**
3035
3036Zed supports all OpenType features that can be enabled or disabled for a given UI font, as well as setting values for font features.
3037
3038For example, to disable font ligatures, add the following to your settings:
3039
3040```json
3041{
3042 "ui_font_features": {
3043 "calt": false
3044 }
3045}
3046```
3047
3048You can also set other OpenType features, like setting `cv01` to `7`:
3049
3050```json
3051{
3052 "ui_font_features": {
3053 "cv01": 7
3054 }
3055}
3056```
3057
3058## UI Font Fallbacks
3059
3060- Description: The font fallbacks to use for text in the UI.
3061- Setting: `ui_font_fallbacks`
3062- Default: `null`
3063- Platform: macOS and Windows.
3064
3065**Options**
3066
3067For example, to use `Nerd Font` as a fallback, add the following to your settings:
3068
3069```json
3070{
3071 "ui_font_fallbacks": ["Nerd Font"]
3072}
3073```
3074
3075## UI Font Size
3076
3077- Description: The default font size for text in the UI.
3078- Setting: `ui_font_size`
3079- Default: `16`
3080
3081**Options**
3082
3083`integer` values from `6` to `100` pixels (inclusive)
3084
3085## UI Font Weight
3086
3087- Description: The default font weight for text in the UI.
3088- Setting: `ui_font_weight`
3089- Default: `400`
3090
3091**Options**
3092
3093`integer` values between `100` and `900`
3094
3095## An example configuration:
3096
3097```json
3098// ~/.config/zed/settings.json
3099{
3100 "theme": "cave-light",
3101 "tab_size": 2,
3102 "preferred_line_length": 80,
3103 "soft_wrap": "none",
3104
3105 "buffer_font_size": 18,
3106 "buffer_font_family": "Zed Plex Mono",
3107
3108 "autosave": "on_focus_change",
3109 "format_on_save": "off",
3110 "vim_mode": false,
3111 "projects_online_by_default": true,
3112 "terminal": {
3113 "font_family": "FiraCode Nerd Font Mono",
3114 "blinking": "off"
3115 },
3116 "languages": {
3117 "C": {
3118 "format_on_save": "language_server",
3119 "preferred_line_length": 64,
3120 "soft_wrap": "preferred_line_length"
3121 }
3122 }
3123}
3124```