1# Configuring Zed
2
3## Folder-specific settings
4
5Folder-specific settings are used to override Zed's global settings for files within a specific directory in the project panel. To get started, create a `.zed` subdirectory and add a `settings.json` within it. It should be noted that folder-specific settings don't need to live only a project's root, but can be defined at multiple levels in the project hierarchy. In setups like this, Zed will find the configuration nearest to the file you are working in and apply those settings to it. In most cases, this level of flexibility won't be needed and a single configuration for all files in a project is all that is required; the `Zed > Settings > Open Local Settings` menu action is built for this case. Running this action will look for a `.zed/settings.json` file at the root of the first top-level directory in your project panel. If it does not exist, it will create it.
6
7The following global settings can be overridden with a folder-specific configuration:
8
9- `copilot`
10- `enable_language_server`
11- `ensure_final_newline_on_save`
12- `format_on_save`
13- `formatter`
14- `hard_tabs`
15- `languages`
16- `preferred_line_length`
17- `remove_trailing_whitespace_on_save`
18- `soft_wrap`
19- `tab_size`
20- `show_copilot_suggestions`
21- `show_whitespaces`
22
23_See the Global settings section for details about these settings_
24
25## Global settings
26
27To get started with editing Zed's global settings, open `~/.config/zed/settings.json` via `⌘` + `,`, the command palette (`zed: open settings`), or the `Zed > Settings > Open Settings` application menu item.
28
29Here are all the currently available settings.
30
31## Active Pane Magnification
32
33- 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.
34- Setting: `active_pane_magnification`
35- Default: `1.0`
36
37**Options**
38
39`float` values
40
41## Autosave
42
43- Description: When to automatically save edited buffers.
44- Setting: `autosave`
45- Default: `off`
46
47**Options**
48
491. To disable autosave, set it to `off`
50
51```json
52{
53 "autosave": "off"
54}
55```
56
572. To autosave when focus changes, use `on_focus_change`:
58
59```json
60{
61 "autosave": "on_focus_change"
62}
63```
64
653. To autosave when the active window changes, use `on_window_change`:
66
67```json
68{
69 "autosave": "on_window_change"
70}
71```
72
734. To autosave after an inactivity period, use `after_delay`:
74
75```json
76{
77 "autosave": {
78 "after_delay": {
79 "milliseconds": 1000
80 }
81 }
82}
83```
84
85## Auto Update
86
87- Description: Whether or not to automatically check for updates.
88- Setting: `auto_update`
89- Default: `true`
90
91**Options**
92
93`boolean` values
94
95## Buffer Font Family
96
97- Description: The name of a font to use for rendering text in the editor.
98- Setting: `buffer_font_family`
99- Default: `Zed Mono`
100
101**Options**
102
103The name of any font family installed on the user's system
104
105## Buffer Font Features
106
107- Description: The OpenType features to enable for text in the editor.
108- Setting: `buffer_font_features`
109- Default: `null`
110
111**Options**
112
113Zed supports a subset of OpenType features that can be enabled or disabled for a given buffer or terminal font. The following [OpenType features](https://en.wikipedia.org/wiki/List_of_typographic_features) can be enabled or disabled too: `calt`, `case`, `cpsp`, `frac`, `liga`, `onum`, `ordn`, `pnum`, `ss01`, `ss02`, `ss03`, `ss04`, `ss05`, `ss06`, `ss07`, `ss08`, `ss09`, `ss10`, `ss11`, `ss12`, `ss13`, `ss14`, `ss15`, `ss16`, `ss17`, `ss18`, `ss19`, `ss20`, `subs`, `sups`, `swsh`, `titl`, `tnum`, `zero`.
114
115For example, to disable ligatures for a given font you can add the following to your settings:
116
117```json
118{
119 "buffer_font_features": {
120 "calt": false
121 }
122}
123```
124
125## Buffer Font Size
126
127- Description: The default font size for text in the editor.
128- Setting: `buffer_font_size`
129- Default: `15`
130
131**Options**
132
133`integer` values
134
135## Confirm Quit
136
137- Description: Whether or not to prompt the user to confirm before closing the application.
138- Setting: `confirm_quit`
139- Default: `false`
140
141**Options**
142
143`boolean` values
144
145## Centered Layout
146
147- Description: Configuration for the centered layout mode.
148- Setting: `centered_layout`
149- Default:
150
151```json
152"centered_layout": {
153 "left_padding": 0.2,
154 "right_padding": 0.2,
155}
156```
157
158**Options**
159
160The `left_padding` and `right_padding` options define the relative width of the
161left 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`.
162
163## Copilot
164
165- Description: Copilot-specific settings.
166- Setting: `copilot`
167- Default:
168
169```json
170"copilot": {
171 "disabled_globs": [
172 ".env"
173 ]
174}
175```
176
177**Options**
178
179### Disabled Globs
180
181- Description: The set of glob patterns for which Copilot should be disabled in any matching file.
182- Setting: `disabled_globs`
183- Default: [".env"]
184
185**Options**
186
187List of `string` values
188
189## Current Line Highlight
190
191- Description: How to highlight the current line in the editor.
192- Setting: `current_line_highlight`
193- Default: `all`
194
195**Options**
196
1971. Don't highlight the current line:
198
199```json
200"current_line_highlight": "none"
201```
202
2032. Highlight the gutter area.
204
205```json
206"current_line_highlight": "gutter"
207```
208
2093. Highlight the editor area.
210
211```json
212"current_line_highlight": "line"
213```
214
2154. Highlight the full line.
216
217```json
218"current_line_highlight": "all"
219```
220
221## Cursor Blink
222
223- Description: Whether or not the cursor blinks.
224- Setting: `cursor_blink`
225- Default: `true`
226
227**Options**
228
229`boolean` values
230
231## Default Dock Anchor
232
233- Description: The default anchor for new docks.
234- Setting: `default_dock_anchor`
235- Default: `bottom`
236
237**Options**
238
2391. Position the dock attached to the bottom of the workspace: `bottom`
2402. Position the dock to the right of the workspace like a side panel: `right`
2413. Position the dock full screen over the entire workspace: `expanded`
242
243## Editor Scrollbar
244
245- Description: Whether or not to show the editor scrollbar and various elements in it.
246- Setting: `scrollbar`
247- Default:
248
249```json
250"scrollbar": {
251 "show": "auto",
252 "cursors": true,
253 "git_diff": true,
254 "search_results": true,
255 "selected_symbol": true,
256 "diagnostics": true
257},
258```
259
260### Show Mode
261
262- Description: When to show the editor scrollbar.
263- Setting: `show`
264- Default: `auto`
265
266**Options**
267
2681. Show the scrollbar if there's important information or follow the system's configured behavior:
269
270```json
271"scrollbar": {
272 "show": "auto"
273}
274```
275
2762. Match the system's configured behavior:
277
278```json
279"scrollbar": {
280 "show": "system"
281}
282```
283
2843. Always show the scrollbar:
285
286```json
287"scrollbar": {
288 "show": "always"
289}
290```
291
2924. Never show the scrollbar:
293
294```json
295"scrollbar": {
296 "show": "never"
297}
298```
299
300### Cursor Indicators
301
302- Description: Whether to show cursor positions in the scrollbar.
303- Setting: `cursors`
304- Default: `true`
305
306**Options**
307
308`boolean` values
309
310### Git Diff Indicators
311
312- Description: Whether to show git diff indicators in the scrollbar.
313- Setting: `git_diff`
314- Default: `true`
315
316**Options**
317
318`boolean` values
319
320### Search Results Indicators
321
322- Description: Whether to show buffer search results in the scrollbar.
323- Setting: `search_results`
324- Default: `true`
325
326**Options**
327
328`boolean` values
329
330### Selected Symbols Indicators
331
332- Description: Whether to show selected symbol occurrences in the scrollbar.
333- Setting: `selected_symbol`
334- Default: `true`
335
336**Options**
337
338`boolean` values
339
340### Diagnostics
341
342- Description: Whether to show diagnostic indicators in the scrollbar.
343- Setting: `diagnostics`
344- Default: `true`
345
346**Options**
347
348`boolean` values
349
350## Editor Tab Bar
351
352- Description: Settings related to the editor's tab bar.
353- Settings: `tab_bar`
354- Default:
355
356```json
357"tab_bar": {
358 "show": true,
359 "show_nav_history_buttons": true
360}
361```
362
363### Show
364
365- Description: Whether or not to show the tab bar in the editor.
366- Setting: `show`
367- Default: `true`
368
369**Options**
370
371`boolean` values
372
373### Navigation History Buttons
374
375- Description: Whether or not to show the navigation history buttons.
376- Setting: `show_nav_history_buttons`
377- Default: `true`
378
379**Options**
380
381`boolean` values
382
383## Editor Tabs
384
385- Description: Configuration for the editor tabs.
386- Setting: `tabs`
387- Default:
388
389```json
390"tabs": {
391 "close_position": "right",
392 "git_status": false
393},
394```
395
396### Close Position
397
398- Description: Where to display close button within a tab.
399- Setting: `close_position`
400- Default: `right`
401
402**Options**
403
4041. Display the close button on the right:
405
406```json
407{
408 "close_position": "right"
409}
410```
411
4122. Display the close button on the left:
413
414```json
415{
416 "close_position": "left"
417}
418```
419
420### Git Status
421
422- Description: Whether or not to show Git file status in tab.
423- Setting: `git_status`
424- Default: `false`
425
426## Editor Toolbar
427
428- Description: Whether or not to show various elements in the editor toolbar.
429- Setting: `toolbar`
430- Default:
431
432```json
433"toolbar": {
434 "breadcrumbs": true,
435 "quick_actions": true
436},
437```
438
439**Options**
440
441Each option controls displaying of a particular toolbar element. If all elements are hidden, the editor toolbar is not displayed.
442
443## Enable Language Server
444
445- Description: Whether or not to use language servers to provide code intelligence.
446- Setting: `enable_language_server`
447- Default: `true`
448
449**Options**
450
451`boolean` values
452
453## Ensure Final Newline On Save
454
455- Description: Whether or not to ensure there's a single newline at the end of a buffer when saving it.
456- Setting: `ensure_final_newline_on_save`
457- Default: `true`
458
459**Options**
460
461`boolean` values
462
463## LSP
464
465- Description: Configuration for language servers.
466- Setting: `lsp`
467- Default: `null`
468
469**Options**
470
471The following settings can be overridden for specific language servers:
472
473- `initialization_options`
474
475To override settings for a language, add an entry for that language server's name to the `lsp` value. Example:
476
477```json
478"lsp": {
479 "rust-analyzer": {
480 "initialization_options": {
481 "check": {
482 "command": "clippy" // rust-analyzer.check.command (default: "check")
483 }
484 }
485 }
486}
487```
488
489## Format On Save
490
491- Description: Whether or not to perform a buffer format before saving.
492- Setting: `format_on_save`
493- Default: `on`
494
495**Options**
496
4971. `on`, enables format on save obeying `formatter` setting:
498
499```json
500{
501 "format_on_save": "on"
502}
503```
504
5052. `off`, disables format on save:
506
507```json
508{
509 "format_on_save": "off"
510}
511```
512
513## Formatter
514
515- Description: How to perform a buffer format.
516- Setting: `formatter`
517- Default: `auto`
518
519**Options**
520
5211. To use the current language server, use `"language_server"`:
522
523```json
524{
525 "formatter": "language_server"
526}
527```
528
5292. 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):
530
531```json
532{
533 "formatter": {
534 "external": {
535 "command": "sed",
536 "arguments": ["-e", "s/ *$//"]
537 }
538 }
539}
540```
541
5423. Or to use code actions provided by the connected language servers, use `"code_actions"` (requires Zed `0.130.x`):
543
544```json
545{
546 "formatter": {
547 "code_actions": {
548 // Use ESLint's --fix:
549 "source.fixAll.eslint": true,
550 // Organize imports on save:
551 "source.organizeImports": true
552 }
553 }
554}
555```
556
557## Code Actions On Format
558
559- Description: The code actions to perform with the primary language server when formatting the buffer.
560- Setting: `code_actions_on_format`
561- Default: `{}`, except for Go it's `{ "source.organizeImports": true }`
562
563**Examples**
564
5651. Organize imports on format in TypeScript and TSX buffers:
566
567```json
568{
569 "languages": {
570 "TypeScript": {
571 "code_actions_on_format": {
572 "source.organizeImports": true
573 }
574 },
575 "TSX": {
576 "code_actions_on_format": {
577 "source.organizeImports": true
578 }
579 }
580 }
581}
582```
583
5842. Run ESLint `fixAll` code action when formatting (requires Zed `0.125.0`):
585
586```json
587{
588 "languages": {
589 "JavaScript": {
590 "code_actions_on_format": {
591 "source.fixAll.eslint": true
592 }
593 }
594 }
595}
596```
597
5983. Run only a single ESLint rule when using `fixAll` (requires Zed `0.125.0`):
599
600```json
601{
602 "languages": {
603 "JavaScript": {
604 "code_actions_on_format": {
605 "source.fixAll.eslint": true
606 }
607 }
608 },
609 "lsp": {
610 "eslint": {
611 "settings": {
612 "codeActionOnSave": {
613 "rules": ["import/order"]
614 }
615 }
616 }
617 }
618}
619```
620
621## Auto close
622
623- Description: Whether to automatically add matching closing characters when typing opening parenthesis, bracket, brace, single or double quote characters.
624- Setting: `use_autoclose`
625- Default: `true`
626
627**Options**
628
629`boolean` values
630
631## Always Treat Brackets As Autoclosed
632
633- Description: Controls how the editor handles the autoclosed characters.
634- Setting: `always_treat_brackets_as_autoclosed`
635- Default: `false`
636
637**Options**
638
639`boolean` values
640
641**Example**
642
643If the setting is set to `true`:
644
6451. Enter in the editor: `)))`
6462. Move the cursor to the start: `^)))`
6473. Enter again: `)))`
648
649The result is still `)))` and not `))))))`, which is what it would be by default.
650
651## File Types
652
653- Setting: `file_types`
654- Description: Configure how Zed selects a language for a file based on its filename or extension. Supports glob entries.
655- Default: `{}`
656
657**Examples**
658
659To interpret all `.c` files as C++, files called `MyLockFile` as TOML and files starting with `Dockerfile` as Dockerfile:
660
661```json
662{
663 "file_types": {
664 "C++": ["c"],
665 "TOML": ["MyLockFile"],
666 "Dockerfile": ["Dockerfile*"]
667 }
668}
669```
670
671## Git
672
673- Description: Configuration for git-related features.
674- Setting: `git`
675- Default:
676
677```json
678{
679 "git": {
680 "git_gutter": "tracked_files",
681 "inline_blame": {
682 "enabled": true
683 }
684 }
685}
686```
687
688### Git Gutter
689
690- Description: Whether or not to show the git gutter.
691- Setting: `git_gutter`
692- Default: `tracked_files`
693
694**Options**
695
6961. Show git gutter in tracked files
697
698```json
699{
700 "git": {
701 "git_gutter": "tracked_files"
702 }
703}
704```
705
7062. Hide git gutter
707
708```json
709{
710 "git": {
711 "git_gutter": "hide"
712 }
713}
714```
715
716### Indent Guides
717
718- Description: Configuration related to indent guides (requires Zed `0.138.0`). Indent guides can be configured separately for each language.
719- Setting: `indent_guides`
720- Default:
721
722```json
723{
724 "indent_guides": {
725 "enabled": true,
726 "line_width": 1,
727 "coloring": "fixed",
728 "background_coloring": "disabled"
729 }
730}
731```
732
733**Options**
734
7351. Disable indent guides
736
737```json
738{
739 "indent_guides": {
740 "enabled": false
741 }
742}
743```
744
7452. Enable indent guides for a specific language.
746
747```json
748{
749 "languages": {
750 "Python": {
751 "indent_guides": {
752 "enabled": true
753 }
754 }
755 }
756}
757```
758
7593. Enable indent aware coloring ("rainbow indentation").
760The colors that are used for different indentation levels are defined in the theme (theme key: `accents`). They can be customized by using theme overrides.
761
762```json
763{
764 "indent_guides": {
765 "enabled": true,
766 "coloring": "indent_aware"
767 }
768}
769```
770
7714. Enable indent aware background coloring ("rainbow indentation").
772The colors that are used for different indentation levels are defined in the theme (theme key: `accents`). They can be customized by using theme overrides.
773
774```json
775{
776 "indent_guides": {
777 "enabled": true,
778 "coloring": "indent_aware",
779 "background_coloring": "indent_aware"
780 }
781}
782```
783
784### Inline Git Blame
785
786- Description: Whether or not to show git blame information inline, on the currently focused line (requires Zed `0.132.0`).
787- Setting: `inline_blame`
788- Default:
789
790```json
791{
792 "git": {
793 "inline_blame": {
794 "enabled": true
795 }
796 }
797}
798```
799
800**Options**
801
8021. Disable inline git blame:
803
804```json
805{
806 "git": {
807 "inline_blame": {
808 "enabled": false
809 }
810 }
811}
812```
813
8142. Only show inline git blame after a delay (that starts after cursor stops moving):
815
816```json
817{
818 "git": {
819 "inline_blame": {
820 "enabled": false,
821 "delay_ms": 500
822 }
823 }
824}
825```
826
827## Hard Tabs
828
829- Description: Whether to indent lines using tab characters or multiple spaces.
830- Setting: `hard_tabs`
831- Default: `false`
832
833**Options**
834
835`boolean` values
836
837## Hover Popover Enabled
838
839- Description: Whether or not to show the informational hover box when moving the mouse over symbols in the editor.
840- Setting: `hover_popover_enabled`
841- Default: `true`
842
843**Options**
844
845`boolean` values
846
847## Inlay hints
848
849- Description: Configuration for displaying extra text with hints in the editor.
850- Setting: `inlay_hints`
851- Default:
852
853```json
854"inlay_hints": {
855 "enabled": false,
856 "show_type_hints": true,
857 "show_parameter_hints": true,
858 "show_other_hints": true,
859 "edit_debounce_ms": 700,
860 "scroll_debounce_ms": 50
861}
862```
863
864**Options**
865
866Inlay hints querying consists of two parts: editor (client) and LSP server.
867With 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.
868At 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.
869
870The following languages have inlay hints preconfigured by Zed:
871
872- [Go](https://docs.zed.dev/languages/go)
873- [Rust](https://docs.zed.dev/languages/rust)
874- [Svelte](https://docs.zed.dev/languages/svelte)
875- [Typescript](https://docs.zed.dev/languages/typescript)
876
877Use the `lsp` section for the server configuration. Examples are provided in the corresponding language documentation.
878
879Hints are not instantly queried in Zed, two kinds of debounces are used, either may be set to 0 to be disabled.
880Settings-related hint updates are not debounced.
881
882## Journal
883
884- Description: Configuration for the journal.
885- Setting: `journal`
886- Default:
887
888```json
889"journal": {
890 "path": "~",
891 "hour_format": "hour12"
892}
893```
894
895### Path
896
897- Description: The path of the directory where journal entries are stored.
898- Setting: `path`
899- Default: `~`
900
901**Options**
902
903`string` values
904
905### Hour Format
906
907- Description: The format to use for displaying hours in the journal.
908- Setting: `hour_format`
909- Default: `hour12`
910
911**Options**
912
9131. 12-hour format:
914
915```json
916{
917 "hour_format": "hour12"
918}
919```
920
9212. 24-hour format:
922
923```json
924{
925 "hour_format": "hour24"
926}
927```
928
929## Languages
930
931- Description: Configuration for specific languages.
932- Setting: `languages`
933- Default: `null`
934
935**Options**
936
937To override settings for a language, add an entry for that languages name to the `languages` value. Example:
938
939```json
940"languages": {
941 "C": {
942 "format_on_save": "off",
943 "preferred_line_length": 64,
944 "soft_wrap": "preferred_line_length"
945 },
946 "JSON": {
947 "tab_size": 4
948 }
949}
950```
951
952The following settings can be overridden for each specific language:
953
954- `enable_language_server`
955- `ensure_final_newline_on_save`
956- `format_on_save`
957- `formatter`
958- `hard_tabs`
959- `preferred_line_length`
960- `remove_trailing_whitespace_on_save`
961- `show_copilot_suggestions`
962- `show_whitespaces`
963- `soft_wrap`
964- `tab_size`
965- `use_autoclose`
966- `always_treat_brackets_as_autoclosed`
967
968These values take in the same options as the root-level settings with the same name.
969
970## Preview tabs
971
972- Description:
973 (requires Zed `0.132.x`) \
974 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. \
975 There are several ways to convert a preview tab into a regular tab:
976
977 - Double-clicking on the file
978 - Double-clicking on the tab header
979 - Using the `project_panel::OpenPermanent` action
980 - Editing the file
981 - Dragging the file to a different pane
982
983- Setting: `preview_tabs`
984- Default:
985
986```json
987"preview_tabs": {
988 "enabled": true,
989 "enable_preview_from_file_finder": false,
990 "enable_preview_from_code_navigation": false,
991}
992```
993
994### Enable preview from file finder
995
996- Description: Determines whether to open files in preview mode when selected from the file finder.
997- Setting: `enable_preview_from_file_finder`
998- Default: `false`
999
1000**Options**
1001
1002`boolean` values
1003
1004### Enable preview from code navigation
1005
1006- Description: Determines whether a preview tab gets replaced when code navigation is used to navigate away from the tab (requires Zed `0.134.x`).
1007- Setting: `enable_preview_from_code_navigation`
1008- Default: `false`
1009
1010**Options**
1011
1012`boolean` values
1013
1014## Preferred Line Length
1015
1016- Description: The column at which to soft-wrap lines, for buffers where soft-wrap is enabled.
1017- Setting: `preferred_line_length`
1018- Default: `80`
1019
1020**Options**
1021
1022`integer` values
1023
1024## Projects Online By Default
1025
1026- Description: Whether or not to show the online projects view by default.
1027- Setting: `projects_online_by_default`
1028- Default: `true`
1029
1030**Options**
1031
1032`boolean` values
1033
1034## Remove Trailing Whitespace On Save
1035
1036- Description: Whether or not to remove any trailing whitespace from lines of a buffer before saving it.
1037- Setting: `remove_trailing_whitespace_on_save`
1038- Default: `true`
1039
1040**Options**
1041
1042`boolean` values
1043
1044## Show Call Status Icon
1045
1046- Description: Whether or not to show the call status icon in the status bar.
1047- Setting: `show_call_status_icon`
1048- Default: `true`
1049
1050**Options**
1051
1052`boolean` values
1053
1054## Show Completions On Input
1055
1056- Description: Whether or not to show completions as you type.
1057- Setting: `show_completions_on_input`
1058- Default: `true`
1059
1060**Options**
1061
1062`boolean` values
1063
1064## Show Completion Documentation
1065
1066- Description: Whether to display inline and alongside documentation for items in the completions menu.
1067- Setting: `show_completion_documentation`
1068- Default: `true`
1069
1070**Options**
1071
1072`boolean` values
1073
1074## Completion Documentation Debounce Delay
1075
1076- Description: The debounce delay before re-querying the language server for completion documentation when not included in original completion list.
1077- Setting: `completion_documentation_secondary_query_debounce`
1078- Default: `300` ms
1079
1080**Options**
1081
1082`integer` values
1083
1084## Show Copilot Suggestions
1085
1086- Description: Whether or not to show Copilot suggestions as you type or wait for a `copilot::Toggle`.
1087- Setting: `show_copilot_suggestions`
1088- Default: `true`
1089
1090**Options**
1091
1092`boolean` values
1093
1094## Show Whitespaces
1095
1096- Description: Whether or not to show render whitespace characters in the editor.
1097- Setting: `show_whitespaces`
1098- Default: `selection`
1099
1100**Options**
1101
11021. `all`
11032. `selection`
11043. `none`
1105
1106## Soft Wrap
1107
1108- Description: Whether or not to automatically wrap lines of text to fit editor / preferred width.
1109- Setting: `soft_wrap`
1110- Default: `none`
1111
1112**Options**
1113
11141. `editor_width`
11152. `preferred_line_length`
11163. `none`
1117
1118## Tab Size
1119
1120- Description: The number of spaces to use for each tab character.
1121- Setting: `tab_size`
1122- Default: `4`
1123
1124**Options**
1125
1126`integer` values
1127
1128## Telemetry
1129
1130- Description: Control what info is collected by Zed.
1131- Setting: `telemetry`
1132- Default:
1133
1134```json
1135"telemetry": {
1136 "diagnostics": true,
1137 "metrics": true
1138},
1139```
1140
1141**Options**
1142
1143### Diagnostics
1144
1145- Description: Setting for sending debug-related data, such as crash reports.
1146- Setting: `diagnostics`
1147- Default: `true`
1148
1149**Options**
1150
1151`boolean` values
1152
1153### Metrics
1154
1155- Description: Setting for sending anonymized usage data, such what languages you're using Zed with.
1156- Setting: `metrics`
1157- Default: `true`
1158
1159**Options**
1160
1161`boolean` values
1162
1163## Terminal
1164
1165- Description: Configuration for the terminal.
1166- Setting: `terminal`
1167- Default:
1168
1169```json
1170"terminal": {
1171 "alternate_scroll": "off",
1172 "blinking": "terminal_controlled",
1173 "copy_on_select": false,
1174 "env": {},
1175 "font_family": null,
1176 "font_features": null,
1177 "font_size": null,
1178 "option_as_meta": false,
1179 "button": false,
1180 "shell": {},
1181 "toolbar": {
1182 "title": true
1183 },
1184 "working_directory": "current_project_directory"
1185}
1186```
1187
1188### Alternate Scroll
1189
1190- 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.
1191- Setting: `alternate_scroll`
1192- Default: `off`
1193
1194**Options**
1195
11961. Default alternate scroll mode to on
1197
1198```json
1199{
1200 "alternate_scroll": "on"
1201}
1202```
1203
12042. Default alternate scroll mode to off
1205
1206```json
1207{
1208 "alternate_scroll": "off"
1209}
1210```
1211
1212### Blinking
1213
1214- Description: Set the cursor blinking behavior in the terminal
1215- Setting: `blinking`
1216- Default: `terminal_controlled`
1217
1218**Options**
1219
12201. Never blink the cursor, ignore the terminal mode
1221
1222```json
1223{
1224 "blinking": "off"
1225}
1226```
1227
12282. Default the cursor blink to off, but allow the terminal to turn blinking on
1229
1230```json
1231{
1232 "blinking": "terminal_controlled"
1233}
1234```
1235
12363. Always blink the cursor, ignore the terminal mode
1237
1238```json
1239"blinking": "on",
1240```
1241
1242### Copy On Select
1243
1244- Description: Whether or not selecting text in the terminal will automatically copy to the system clipboard.
1245- Setting: `copy_on_select`
1246- Default: `false`
1247
1248**Options**
1249
1250`boolean` values
1251
1252### Env
1253
1254- 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
1255- Setting: `env`
1256- Default: `{}`
1257
1258**Example**
1259
1260```json
1261"env": {
1262 "ZED": "1",
1263 "KEY": "value1:value2"
1264}
1265```
1266
1267### Font Size
1268
1269- Description: What font size to use for the terminal. When not set defaults to matching the editor's font size
1270- Setting: `font_size`
1271- Default: `null`
1272
1273**Options**
1274
1275`integer` values
1276
1277### Font Family
1278
1279- Description: What font to use for the terminal. When not set, defaults to matching the editor's font.
1280- Setting: `font_family`
1281- Default: `null`
1282
1283**Options**
1284
1285The name of any font family installed on the user's system
1286
1287### Font Features
1288
1289- Description: What font features to use for the terminal. When not set, defaults to matching the editor's font features.
1290- Setting: `font_features`
1291- Default: `null`
1292
1293**Options**
1294
1295See Buffer Font Features
1296
1297### Option As Meta
1298
1299- Description: Re-interprets the option keys to act like a 'meta' key, like in Emacs.
1300- Setting: `option_as_meta`
1301- Default: `true`
1302
1303**Options**
1304
1305`boolean` values
1306
1307### Shell
1308
1309- Description: What shell to use when launching the terminal.
1310- Setting: `shell`
1311- Default: `system`
1312
1313**Options**
1314
13151. Use the system's default terminal configuration (usually the `/etc/passwd` file).
1316
1317```json
1318{
1319 "shell": "system"
1320}
1321```
1322
13232. A program to launch:
1324
1325```json
1326"shell": {
1327 "program": "sh"
1328}
1329```
1330
13313. A program with arguments:
1332
1333```json
1334"shell": {
1335 "with_arguments": {
1336 "program": "/bin/bash",
1337 "args": ["--login"]
1338 }
1339}
1340```
1341
1342## Terminal Toolbar
1343
1344- Description: Whether or not to show various elements in the terminal toolbar. It only affects terminals placed in the editor pane.
1345- Setting: `toolbar`
1346- Default:
1347
1348```json
1349"toolbar": {
1350 "title": true,
1351},
1352```
1353
1354**Options**
1355
1356At the moment, only the `title` option is available, it controls displaying of the terminal title that can be changed via `PROMPT_COMMAND`. If the title is hidden, the terminal toolbar is not displayed.
1357
1358### Terminal Button
1359
1360- Description: Control to show or hide the terminal button in the status bar
1361- Setting: `button`
1362- Default: `true`
1363
1364**Options**
1365
1366`boolean` values
1367
1368### Working Directory
1369
1370- Description: What working directory to use when launching the terminal.
1371- Setting: `working_directory`
1372- Default: `"current_project_directory"`
1373
1374**Options**
1375
13761. Use the current file's project directory. Will Fallback to the first project directory strategy if unsuccessful
1377
1378```json
1379{
1380 "working_directory": "current_project_directory"
1381}
1382```
1383
13842. Use the first project in this workspace's directory. Will fallback to using this platform's home directory.
1385
1386```json
1387{
1388 "working_directory": "first_project_directory"
1389}
1390```
1391
13923. Always use this platform's home directory (if we can find it)
1393
1394```json
1395{
1396 "working_directory": "always_home"
1397}
1398```
1399
14004. 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.
1401
1402```json
1403"working_directory": {
1404 "always": {
1405 "directory": "~/zed/projects/"
1406 }
1407}
1408```
1409
1410## Theme
1411
1412- 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.
1413- Setting: `theme`
1414- Default: `One Dark`
1415
1416### Theme Object
1417
1418- Description: Specify the theme using an object that includes the `mode`, `dark`, and `light` themes.
1419- Setting: `theme`
1420- Default:
1421
1422```json
1423"theme": {
1424 "mode": "dark",
1425 "dark": "One Dark",
1426 "light": "One Light"
1427},
1428```
1429
1430### Mode
1431
1432- Description: Specify theme mode.
1433- Setting: `mode`
1434- Default: `dark`
1435
1436**Options**
1437
14381. Set the theme to dark mode
1439
1440```json
1441{
1442 "mode": "dark"
1443}
1444```
1445
14462. Set the theme to light mode
1447
1448```json
1449{
1450 "mode": "light"
1451}
1452```
1453
14543. Set the theme to system mode
1455
1456```json
1457{
1458 "mode": "system"
1459}
1460```
1461
1462### Dark
1463
1464- Description: The name of the dark Zed theme to use for the UI.
1465- Setting: `dark`
1466- Default: `One Dark`
1467
1468**Options**
1469
1470Run the `theme selector: toggle` action in the command palette to see a current list of valid themes names.
1471
1472### Light
1473
1474- Description: The name of the light Zed theme to use for the UI.
1475- Setting: `light`
1476- Default: `One Light`
1477
1478**Options**
1479
1480Run the `theme selector: toggle` action in the command palette to see a current list of valid themes names.
1481
1482## Vim
1483
1484- Description: Whether or not to enable vim mode (work in progress).
1485- Setting: `vim_mode`
1486- Default: `false`
1487
1488## Project Panel
1489
1490- Description: Customise project panel
1491- Setting: `project_panel`
1492- Default:
1493
1494```json
1495"project_panel": {
1496 "button": true,
1497 "dock": "left",
1498 "git_status": true,
1499 "default_width": "N/A - width in pixels"
1500},
1501```
1502
1503### Dock
1504
1505- Description: Control the position of the dock
1506- Setting: `dock`
1507- Default: `left`
1508
1509**Options**
1510
15111. Default dock position to left
1512
1513```json
1514{
1515 "dock": "left"
1516}
1517```
1518
15192. Default dock position to right
1520
1521```json
1522{
1523 "dock": "right"
1524}
1525```
1526
1527### Git Status
1528
1529- Description: Indicates newly created and updated files
1530- Setting: `git_status`
1531- Default: `true`
1532
15331. Default enable git status
1534
1535```json
1536{
1537 "git_status": true
1538}
1539```
1540
15412. Default disable git status
1542
1543```json
1544{
1545 "git_status": false
1546}
1547```
1548
1549### Default Width
1550
1551- Description: Customise default width taken by project panel
1552- Setting: `default_width`
1553- Default: N/A width in pixels (eg: 420)
1554
1555**Options**
1556
1557`boolean` values
1558
1559## Calls
1560
1561- Description: Customise behaviour when participating in a call
1562- Setting: `calls`
1563- Default:
1564
1565```json
1566"calls": {
1567 // Join calls with the microphone live by default
1568 "mute_on_join": false,
1569 // Share your project when you are the first to join a channel
1570 "share_on_join": true
1571},
1572```
1573
1574## An example configuration:
1575
1576```json
1577// ~/.config/zed/settings.json
1578{
1579 "theme": "cave-light",
1580 "tab_size": 2,
1581 "preferred_line_length": 80,
1582 "soft_wrap": "none",
1583
1584 "buffer_font_size": 18,
1585 "buffer_font_family": "Zed Mono",
1586
1587 "autosave": "on_focus_change",
1588 "format_on_save": "off",
1589 "vim_mode": false,
1590 "projects_online_by_default": true,
1591 "terminal": {
1592 "font_family": "FiraCode Nerd Font Mono",
1593 "blinking": "off"
1594 },
1595 "languages": {
1596 "C": {
1597 "format_on_save": "language_server",
1598 "preferred_line_length": 64,
1599 "soft_wrap": "preferred_line_length"
1600 }
1601 }
1602}
1603```