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