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::OpenLocalSettings} 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 Magnification
33
34- 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.
35- Setting: `active_pane_magnification`
36- Default: `1.0`
37
38**Options**
39
40`float` values
41
42## Autosave
43
44- Description: When to automatically save edited buffers.
45- Setting: `autosave`
46- Default: `off`
47
48**Options**
49
501. To disable autosave, set it to `off`:
51
52```json
53{
54 "autosave": "off"
55}
56```
57
582. To autosave when focus changes, use `on_focus_change`:
59
60```json
61{
62 "autosave": "on_focus_change"
63}
64```
65
663. To autosave when the active window changes, use `on_window_change`:
67
68```json
69{
70 "autosave": "on_window_change"
71}
72```
73
744. To autosave after an inactivity period, use `after_delay`:
75
76```json
77{
78 "autosave": {
79 "after_delay": {
80 "milliseconds": 1000
81 }
82 }
83}
84```
85
86## Auto Update
87
88- Description: Whether or not to automatically check for updates.
89- Setting: `auto_update`
90- Default: `true`
91
92**Options**
93
94`boolean` values
95
96## Buffer Font Family
97
98- Description: The name of a font to use for rendering text in the editor.
99- Setting: `buffer_font_family`
100- Default: `Zed Plex Mono`
101
102**Options**
103
104The name of any font family installed on the user's system
105
106## Buffer Font Features
107
108- Description: The OpenType features to enable for text in the editor.
109- Setting: `buffer_font_features`
110- Default: `null`
111
112**Options**
113
114Zed 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.
115
116For example, to disable font ligatures, add the following to your settings:
117
118```json
119{
120 "buffer_font_features": {
121 "calt": false
122 }
123}
124```
125
126You can also set other OpenType features, like setting `cv01` to `7`:
127
128```json
129{
130 "buffer_font_features": {
131 "cv01": 7
132 }
133}
134```
135
136## Buffer Font Size
137
138- Description: The default font size for text in the editor.
139- Setting: `buffer_font_size`
140- Default: `15`
141
142**Options**
143
144`integer` values
145
146## Buffer Font Weight
147
148- Description: The default font weight for text in the editor.
149- Setting: `buffer_font_weight`
150- Default: `400`
151
152**Options**
153
154`integer` values between `100` and `900`
155
156## Buffer Line Height
157
158- Description: The default line height for text in the editor.
159- Setting: `buffer_line_height`
160- Default: `"comfortable"`
161
162**Options**
163
164`"standard"`, `"comfortable"` or `{"custom": float}` (`1` is very compact, `2` very loose)
165
166## Confirm Quit
167
168- Description: Whether or not to prompt the user to confirm before closing the application.
169- Setting: `confirm_quit`
170- Default: `false`
171
172**Options**
173
174`boolean` values
175
176## Centered Layout
177
178- Description: Configuration for the centered layout mode.
179- Setting: `centered_layout`
180- Default:
181
182```json
183"centered_layout": {
184 "left_padding": 0.2,
185 "right_padding": 0.2,
186}
187```
188
189**Options**
190
191The `left_padding` and `right_padding` options define the relative width of the
192left 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`.
193
194## Direnv Integration
195
196- Description: Settings for [direnv](https://direnv.net/) integration. Requires `direnv` to be installed. `direnv` integration currently only means that the environment variables set by a `direnv` configuration can be used to detect some language servers in `$PATH` instead of installing them.
197- Setting: `load_direnv`
198- Default:
199
200```json
201"load_direnv": "shell_hook"
202```
203
204**Options**
205There are two options to choose from:
206
2071. `shell_hook`: Use the shell hook to load direnv. This relies on direnv to activate upon entering the directory. Supports POSIX shells and fish.
2082. `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.
209
210## Inline Completions
211
212- Description: Settings for inline completions.
213- Setting: `inline_completions`
214- Default:
215
216```json
217"inline_completions": {
218 "disabled_globs": [
219 ".env"
220 ]
221}
222```
223
224**Options**
225
226### Disabled Globs
227
228- Description: A list of globs representing files that inline completions should be disabled for.
229- Setting: `disabled_globs`
230- Default: `[".env"]`
231
232**Options**
233
234List of `string` values
235
236## Current Line Highlight
237
238- Description: How to highlight the current line in the editor.
239- Setting: `current_line_highlight`
240- Default: `all`
241
242**Options**
243
2441. Don't highlight the current line:
245
246```json
247"current_line_highlight": "none"
248```
249
2502. Highlight the gutter area:
251
252```json
253"current_line_highlight": "gutter"
254```
255
2563. Highlight the editor area:
257
258```json
259"current_line_highlight": "line"
260```
261
2624. Highlight the full line:
263
264```json
265"current_line_highlight": "all"
266```
267
268## Cursor Blink
269
270- Description: Whether or not the cursor blinks.
271- Setting: `cursor_blink`
272- Default: `true`
273
274**Options**
275
276`boolean` values
277
278## Default Dock Anchor
279
280- Description: The default anchor for new docks.
281- Setting: `default_dock_anchor`
282- Default: `bottom`
283
284**Options**
285
2861. Position the dock attached to the bottom of the workspace: `bottom`
2872. Position the dock to the right of the workspace like a side panel: `right`
2883. Position the dock full screen over the entire workspace: `expanded`
289
290## Editor Scrollbar
291
292- Description: Whether or not to show the editor scrollbar and various elements in it.
293- Setting: `scrollbar`
294- Default:
295
296```json
297"scrollbar": {
298 "show": "auto",
299 "cursors": true,
300 "git_diff": true,
301 "search_results": true,
302 "selected_symbol": true,
303 "diagnostics": true
304},
305```
306
307### Show Mode
308
309- Description: When to show the editor scrollbar.
310- Setting: `show`
311- Default: `auto`
312
313**Options**
314
3151. Show the scrollbar if there's important information or follow the system's configured behavior:
316
317```json
318"scrollbar": {
319 "show": "auto"
320}
321```
322
3232. Match the system's configured behavior:
324
325```json
326"scrollbar": {
327 "show": "system"
328}
329```
330
3313. Always show the scrollbar:
332
333```json
334"scrollbar": {
335 "show": "always"
336}
337```
338
3394. Never show the scrollbar:
340
341```json
342"scrollbar": {
343 "show": "never"
344}
345```
346
347### Cursor Indicators
348
349- Description: Whether to show cursor positions in the scrollbar.
350- Setting: `cursors`
351- Default: `true`
352
353**Options**
354
355`boolean` values
356
357### Git Diff Indicators
358
359- Description: Whether to show git diff indicators in the scrollbar.
360- Setting: `git_diff`
361- Default: `true`
362
363**Options**
364
365`boolean` values
366
367### Search Results Indicators
368
369- Description: Whether to show buffer search results in the scrollbar.
370- Setting: `search_results`
371- Default: `true`
372
373**Options**
374
375`boolean` values
376
377### Selected Symbols Indicators
378
379- Description: Whether to show selected symbol occurrences in the scrollbar.
380- Setting: `selected_symbol`
381- Default: `true`
382
383**Options**
384
385`boolean` values
386
387### Diagnostics
388
389- Description: Whether to show diagnostic indicators in the scrollbar.
390- Setting: `diagnostics`
391- Default: `true`
392
393**Options**
394
395`boolean` values
396
397## Editor Tab Bar
398
399- Description: Settings related to the editor's tab bar.
400- Settings: `tab_bar`
401- Default:
402
403```json
404"tab_bar": {
405 "show": true,
406 "show_nav_history_buttons": true
407}
408```
409
410### Show
411
412- Description: Whether or not to show the tab bar in the editor.
413- Setting: `show`
414- Default: `true`
415
416**Options**
417
418`boolean` values
419
420### Navigation History Buttons
421
422- Description: Whether or not to show the navigation history buttons.
423- Setting: `show_nav_history_buttons`
424- Default: `true`
425
426**Options**
427
428`boolean` values
429
430## Editor Tabs
431
432- Description: Configuration for the editor tabs.
433- Setting: `tabs`
434- Default:
435
436```json
437"tabs": {
438 "close_position": "right",
439 "file_icons": false,
440 "git_status": false
441},
442```
443
444### Close Position
445
446- Description: Where to display close button within a tab.
447- Setting: `close_position`
448- Default: `right`
449
450**Options**
451
4521. Display the close button on the right:
453
454```json
455{
456 "close_position": "right"
457}
458```
459
4602. Display the close button on the left:
461
462```json
463{
464 "close_position": "left"
465}
466```
467
468### File Icons
469
470- Description: Whether to show the file icon for a tab.
471- Setting: `file_icons`
472- Default: `false`
473
474### Git Status
475
476- Description: Whether or not to show Git file status in tab.
477- Setting: `git_status`
478- Default: `false`
479
480## Editor Toolbar
481
482- Description: Whether or not to show various elements in the editor toolbar.
483- Setting: `toolbar`
484- Default:
485
486```json
487"toolbar": {
488 "breadcrumbs": true,
489 "quick_actions": true
490},
491```
492
493**Options**
494
495Each option controls displaying of a particular toolbar element. If all elements are hidden, the editor toolbar is not displayed.
496
497## Enable Language Server
498
499- Description: Whether or not to use language servers to provide code intelligence.
500- Setting: `enable_language_server`
501- Default: `true`
502
503**Options**
504
505`boolean` values
506
507## Ensure Final Newline On Save
508
509- Description: Whether or not to ensure there's a single newline at the end of a buffer when saving it.
510- Setting: `ensure_final_newline_on_save`
511- Default: `true`
512
513**Options**
514
515`boolean` values
516
517## LSP
518
519- Description: Configuration for language servers.
520- Setting: `lsp`
521- Default: `null`
522
523**Options**
524
525The following settings can be overridden for specific language servers:
526
527- `initialization_options`
528
529To override settings for a language, add an entry for that language server's name to the `lsp` value. Example:
530
531```json
532"lsp": {
533 "rust-analyzer": {
534 "initialization_options": {
535 "check": {
536 "command": "clippy" // rust-analyzer.check.command (default: "check")
537 }
538 }
539 }
540}
541```
542
543## Format On Save
544
545- Description: Whether or not to perform a buffer format before saving.
546- Setting: `format_on_save`
547- Default: `on`
548
549**Options**
550
5511. `on`, enables format on save obeying `formatter` setting:
552
553```json
554{
555 "format_on_save": "on"
556}
557```
558
5592. `off`, disables format on save:
560
561```json
562{
563 "format_on_save": "off"
564}
565```
566
567## Formatter
568
569- Description: How to perform a buffer format.
570- Setting: `formatter`
571- Default: `auto`
572
573**Options**
574
5751. To use the current language server, use `"language_server"`:
576
577```json
578{
579 "formatter": "language_server"
580}
581```
582
5832. 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):
584
585```json
586{
587 "formatter": {
588 "external": {
589 "command": "sed",
590 "arguments": ["-e", "s/ *$//"]
591 }
592 }
593}
594```
595
5963. Or to use code actions provided by the connected language servers, use `"code_actions"`:
597
598```json
599{
600 "formatter": {
601 "code_actions": {
602 // Use ESLint's --fix:
603 "source.fixAll.eslint": true,
604 // Organize imports on save:
605 "source.organizeImports": true
606 }
607 }
608}
609```
610
6114. Or to use multiple formatters consecutively, use an array of formatters:
612
613```json
614{
615 "formatter": [
616 {"language_server": {"name": "rust-analyzer"}},
617 {"external": {
618 "command": "sed",
619 "arguments": ["-e", "s/ *$//"]
620 }
621 ]
622}
623```
624
625Here `rust-analyzer` will be used first to format the code, followed by a call of sed.
626If any of the formatters fails, the subsequent ones will still be executed.
627
628## Code Actions On Format
629
630- Description: The code actions to perform with the primary language server when formatting the buffer.
631- Setting: `code_actions_on_format`
632- Default: `{}`, except for Go it's `{ "source.organizeImports": true }`
633
634**Examples**
635
636<!--
637TBD: Add Python Ruff source.organizeImports example
638-->
639
6401. Organize imports on format in TypeScript and TSX buffers:
641
642```json
643{
644 "languages": {
645 "TypeScript": {
646 "code_actions_on_format": {
647 "source.organizeImports": true
648 }
649 },
650 "TSX": {
651 "code_actions_on_format": {
652 "source.organizeImports": true
653 }
654 }
655 }
656}
657```
658
6592. Run ESLint `fixAll` code action when formatting:
660
661```json
662{
663 "languages": {
664 "JavaScript": {
665 "code_actions_on_format": {
666 "source.fixAll.eslint": true
667 }
668 }
669 }
670}
671```
672
6733. Run only a single ESLint rule when using `fixAll`:
674
675```json
676{
677 "languages": {
678 "JavaScript": {
679 "code_actions_on_format": {
680 "source.fixAll.eslint": true
681 }
682 }
683 },
684 "lsp": {
685 "eslint": {
686 "settings": {
687 "codeActionOnSave": {
688 "rules": ["import/order"]
689 }
690 }
691 }
692 }
693}
694```
695
696## Auto close
697
698- Description: Whether to automatically add matching closing characters when typing opening parenthesis, bracket, brace, single or double quote characters.
699- Setting: `use_autoclose`
700- Default: `true`
701
702**Options**
703
704`boolean` values
705
706## Always Treat Brackets As Autoclosed
707
708- Description: Controls how the editor handles the autoclosed characters.
709- Setting: `always_treat_brackets_as_autoclosed`
710- Default: `false`
711
712**Options**
713
714`boolean` values
715
716**Example**
717
718If the setting is set to `true`:
719
7201. Enter in the editor: `)))`
7212. Move the cursor to the start: `^)))`
7223. Enter again: `)))`
723
724The result is still `)))` and not `))))))`, which is what it would be by default.
725
726## File Types
727
728- Setting: `file_types`
729- Description: Configure how Zed selects a language for a file based on its filename or extension. Supports glob entries.
730- Default: `{}`
731
732**Examples**
733
734To interpret all `.c` files as C++, files called `MyLockFile` as TOML and files starting with `Dockerfile` as Dockerfile:
735
736```json
737{
738 "file_types": {
739 "C++": ["c"],
740 "TOML": ["MyLockFile"],
741 "Dockerfile": ["Dockerfile*"]
742 }
743}
744```
745
746## Git
747
748- Description: Configuration for git-related features.
749- Setting: `git`
750- Default:
751
752```json
753{
754 "git": {
755 "git_gutter": "tracked_files",
756 "inline_blame": {
757 "enabled": true
758 }
759 }
760}
761```
762
763### Git Gutter
764
765- Description: Whether or not to show the git gutter.
766- Setting: `git_gutter`
767- Default: `tracked_files`
768
769**Options**
770
7711. Show git gutter in tracked files
772
773```json
774{
775 "git": {
776 "git_gutter": "tracked_files"
777 }
778}
779```
780
7812. Hide git gutter
782
783```json
784{
785 "git": {
786 "git_gutter": "hide"
787 }
788}
789```
790
791### Indent Guides
792
793- Description: Configuration related to indent guides. Indent guides can be configured separately for each language.
794- Setting: `indent_guides`
795- Default:
796
797```json
798{
799 "indent_guides": {
800 "enabled": true,
801 "line_width": 1,
802 "active_line_width": 1,
803 "coloring": "fixed",
804 "background_coloring": "disabled"
805 }
806}
807```
808
809**Options**
810
8111. Disable indent guides
812
813```json
814{
815 "indent_guides": {
816 "enabled": false
817 }
818}
819```
820
8212. Enable indent guides for a specific language.
822
823```json
824{
825 "languages": {
826 "Python": {
827 "indent_guides": {
828 "enabled": true
829 }
830 }
831 }
832}
833```
834
8353. Enable indent aware coloring ("rainbow indentation").
836 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.
837
838```json
839{
840 "indent_guides": {
841 "enabled": true,
842 "coloring": "indent_aware"
843 }
844}
845```
846
8474. Enable indent aware background coloring ("rainbow indentation").
848 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.
849
850```json
851{
852 "indent_guides": {
853 "enabled": true,
854 "coloring": "indent_aware",
855 "background_coloring": "indent_aware"
856 }
857}
858```
859
860### Inline Git Blame
861
862- Description: Whether or not to show git blame information inline, on the currently focused line.
863- Setting: `inline_blame`
864- Default:
865
866```json
867{
868 "git": {
869 "inline_blame": {
870 "enabled": true
871 }
872 }
873}
874```
875
876**Options**
877
8781. Disable inline git blame:
879
880```json
881{
882 "git": {
883 "inline_blame": {
884 "enabled": false
885 }
886 }
887}
888```
889
8902. Only show inline git blame after a delay (that starts after cursor stops moving):
891
892```json
893{
894 "git": {
895 "inline_blame": {
896 "enabled": true,
897 "delay_ms": 500
898 }
899 }
900}
901```
902
903## Hard Tabs
904
905- Description: Whether to indent lines using tab characters or multiple spaces.
906- Setting: `hard_tabs`
907- Default: `false`
908
909**Options**
910
911`boolean` values
912
913## Hover Popover Enabled
914
915- Description: Whether or not to show the informational hover box when moving the mouse over symbols in the editor.
916- Setting: `hover_popover_enabled`
917- Default: `true`
918
919**Options**
920
921`boolean` values
922
923## Inlay hints
924
925- Description: Configuration for displaying extra text with hints in the editor.
926- Setting: `inlay_hints`
927- Default:
928
929```json
930"inlay_hints": {
931 "enabled": false,
932 "show_type_hints": true,
933 "show_parameter_hints": true,
934 "show_other_hints": true,
935 "edit_debounce_ms": 700,
936 "scroll_debounce_ms": 50
937}
938```
939
940**Options**
941
942Inlay hints querying consists of two parts: editor (client) and LSP server.
943With 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.
944At 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.
945
946The following languages have inlay hints preconfigured by Zed:
947
948- [Go](https://docs.zed.dev/languages/go)
949- [Rust](https://docs.zed.dev/languages/rust)
950- [Svelte](https://docs.zed.dev/languages/svelte)
951- [Typescript](https://docs.zed.dev/languages/typescript)
952
953Use the `lsp` section for the server configuration. Examples are provided in the corresponding language documentation.
954
955Hints are not instantly queried in Zed, two kinds of debounces are used, either may be set to 0 to be disabled.
956Settings-related hint updates are not debounced.
957
958## Journal
959
960- Description: Configuration for the journal.
961- Setting: `journal`
962- Default:
963
964```json
965"journal": {
966 "path": "~",
967 "hour_format": "hour12"
968}
969```
970
971### Path
972
973- Description: The path of the directory where journal entries are stored.
974- Setting: `path`
975- Default: `~`
976
977**Options**
978
979`string` values
980
981### Hour Format
982
983- Description: The format to use for displaying hours in the journal.
984- Setting: `hour_format`
985- Default: `hour12`
986
987**Options**
988
9891. 12-hour format:
990
991```json
992{
993 "hour_format": "hour12"
994}
995```
996
9972. 24-hour format:
998
999```json
1000{
1001 "hour_format": "hour24"
1002}
1003```
1004
1005## Languages
1006
1007- Description: Configuration for specific languages.
1008- Setting: `languages`
1009- Default: `null`
1010
1011**Options**
1012
1013To override settings for a language, add an entry for that languages name to the `languages` value. Example:
1014
1015```json
1016"languages": {
1017 "C": {
1018 "format_on_save": "off",
1019 "preferred_line_length": 64,
1020 "soft_wrap": "preferred_line_length"
1021 },
1022 "JSON": {
1023 "tab_size": 4
1024 }
1025}
1026```
1027
1028The following settings can be overridden for each specific language:
1029
1030- `enable_language_server`
1031- `ensure_final_newline_on_save`
1032- `format_on_save`
1033- `formatter`
1034- `hard_tabs`
1035- `preferred_line_length`
1036- `remove_trailing_whitespace_on_save`
1037- `show_inline_completions`
1038- `show_whitespaces`
1039- `soft_wrap`
1040- `tab_size`
1041- `use_autoclose`
1042- `always_treat_brackets_as_autoclosed`
1043
1044These values take in the same options as the root-level settings with the same name.
1045
1046## Preview tabs
1047
1048- Description:
1049 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. \
1050 There are several ways to convert a preview tab into a regular tab:
1051
1052 - Double-clicking on the file
1053 - Double-clicking on the tab header
1054 - Using the `project_panel::OpenPermanent` action
1055 - Editing the file
1056 - Dragging the file to a different pane
1057
1058- Setting: `preview_tabs`
1059- Default:
1060
1061```json
1062"preview_tabs": {
1063 "enabled": true,
1064 "enable_preview_from_file_finder": false,
1065 "enable_preview_from_code_navigation": false,
1066}
1067```
1068
1069### Enable preview from file finder
1070
1071- Description: Determines whether to open files in preview mode when selected from the file finder.
1072- Setting: `enable_preview_from_file_finder`
1073- Default: `false`
1074
1075**Options**
1076
1077`boolean` values
1078
1079### Enable preview from code navigation
1080
1081- Description: Determines whether a preview tab gets replaced when code navigation is used to navigate away from the tab.
1082- Setting: `enable_preview_from_code_navigation`
1083- Default: `false`
1084
1085**Options**
1086
1087`boolean` values
1088
1089## Preferred Line Length
1090
1091- Description: The column at which to soft-wrap lines, for buffers where soft-wrap is enabled.
1092- Setting: `preferred_line_length`
1093- Default: `80`
1094
1095**Options**
1096
1097`integer` values
1098
1099## Projects Online By Default
1100
1101- Description: Whether or not to show the online projects view by default.
1102- Setting: `projects_online_by_default`
1103- Default: `true`
1104
1105**Options**
1106
1107`boolean` values
1108
1109## Remove Trailing Whitespace On Save
1110
1111- Description: Whether or not to remove any trailing whitespace from lines of a buffer before saving it.
1112- Setting: `remove_trailing_whitespace_on_save`
1113- Default: `true`
1114
1115**Options**
1116
1117`boolean` values
1118
1119## Show Call Status Icon
1120
1121- Description: Whether or not to show the call status icon in the status bar.
1122- Setting: `show_call_status_icon`
1123- Default: `true`
1124
1125**Options**
1126
1127`boolean` values
1128
1129## Show Completions On Input
1130
1131- Description: Whether or not to show completions as you type.
1132- Setting: `show_completions_on_input`
1133- Default: `true`
1134
1135**Options**
1136
1137`boolean` values
1138
1139## Show Completion Documentation
1140
1141- Description: Whether to display inline and alongside documentation for items in the completions menu.
1142- Setting: `show_completion_documentation`
1143- Default: `true`
1144
1145**Options**
1146
1147`boolean` values
1148
1149## Completion Documentation Debounce Delay
1150
1151- Description: The debounce delay before re-querying the language server for completion documentation when not included in original completion list.
1152- Setting: `completion_documentation_secondary_query_debounce`
1153- Default: `300` ms
1154
1155**Options**
1156
1157`integer` values
1158
1159## Show Inline Completions
1160
1161- Description: Whether to show inline completions as you type or manually by triggering `editor::ShowInlineCompletion`.
1162- Setting: `show_inline_completions`
1163- Default: `true`
1164
1165**Options**
1166
1167`boolean` values
1168
1169## Show Whitespaces
1170
1171- Description: Whether or not to show render whitespace characters in the editor.
1172- Setting: `show_whitespaces`
1173- Default: `selection`
1174
1175**Options**
1176
11771. `all`
11782. `selection`
11793. `none`
11804. `boundary`
1181
1182## Soft Wrap
1183
1184- Description: Whether or not to automatically wrap lines of text to fit editor / preferred width.
1185- Setting: `soft_wrap`
1186- Default: `prefer_line`
1187
1188**Options**
1189
11901. `none` to stop the soft-wrapping
11912. `prefer_line` to avoid wrapping generally, unless the line is too long
11923. `editor_width` to wrap lines that overflow the editor width
11934. `preferred_line_length` to wrap lines that overflow `preferred_line_length` config value
1194
1195## Wrap Guides (Vertical Rulers)
1196
1197- Description: Where to display vertical rulers as wrap-guides. Disable by setting `show_wrap_guides` to `false`.
1198- Setting: `wrap_guides`
1199- Default: []
1200
1201**Options**
1202
1203List of `integer` column numbers
1204
1205## Tab Size
1206
1207- Description: The number of spaces to use for each tab character.
1208- Setting: `tab_size`
1209- Default: `4`
1210
1211**Options**
1212
1213`integer` values
1214
1215## Telemetry
1216
1217- Description: Control what info is collected by Zed.
1218- Setting: `telemetry`
1219- Default:
1220
1221```json
1222"telemetry": {
1223 "diagnostics": true,
1224 "metrics": true
1225},
1226```
1227
1228**Options**
1229
1230### Diagnostics
1231
1232- Description: Setting for sending debug-related data, such as crash reports.
1233- Setting: `diagnostics`
1234- Default: `true`
1235
1236**Options**
1237
1238`boolean` values
1239
1240### Metrics
1241
1242- Description: Setting for sending anonymized usage data, such what languages you're using Zed with.
1243- Setting: `metrics`
1244- Default: `true`
1245
1246**Options**
1247
1248`boolean` values
1249
1250## Terminal
1251
1252- Description: Configuration for the terminal.
1253- Setting: `terminal`
1254- Default:
1255
1256```json
1257{
1258 "terminal": {
1259 "alternate_scroll": "off",
1260 "blinking": "terminal_controlled",
1261 "copy_on_select": false,
1262 "dock": "bottom",
1263 "env": {},
1264 "font_family": null,
1265 "font_features": null,
1266 "font_size": null,
1267 "line_height": "comfortable",
1268 "option_as_meta": true,
1269 "button": false,
1270 "shell": {},
1271 "toolbar": {
1272 "title": true
1273 },
1274 "working_directory": "current_project_directory"
1275 }
1276}
1277```
1278
1279### Terminal: Dock
1280
1281- Description: Control the position of the dock
1282- Setting: `dock`
1283- Default: `bottom`
1284
1285**Options**
1286
1287`"bottom"`, `"left"` or `"right"`
1288
1289### Terminal: Alternate Scroll
1290
1291- 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.
1292- Setting: `alternate_scroll`
1293- Default: `off`
1294
1295**Options**
1296
12971. Default alternate scroll mode to on
1298
1299```json
1300{
1301 "terminal": {
1302 "alternate_scroll": "on"
1303 }
1304}
1305```
1306
13072. Default alternate scroll mode to off
1308
1309```json
1310{
1311 "terminal": {
1312 "alternate_scroll": "off"
1313 }
1314}
1315```
1316
1317### Terminal: Blinking
1318
1319- Description: Set the cursor blinking behavior in the terminal
1320- Setting: `blinking`
1321- Default: `terminal_controlled`
1322
1323**Options**
1324
13251. Never blink the cursor, ignore the terminal mode
1326
1327```json
1328{
1329 "terminal": {
1330 "blinking": "off"
1331 }
1332}
1333```
1334
13352. Default the cursor blink to off, but allow the terminal to turn blinking on
1336
1337```json
1338{
1339 "terminal": {
1340 "blinking": "terminal_controlled"
1341 }
1342}
1343```
1344
13453. Always blink the cursor, ignore the terminal mode
1346
1347```json
1348{
1349 "terminal": {
1350 "blinking": "on"
1351 }
1352}
1353```
1354
1355### Terminal: Copy On Select
1356
1357- Description: Whether or not selecting text in the terminal will automatically copy to the system clipboard.
1358- Setting: `copy_on_select`
1359- Default: `false`
1360
1361**Options**
1362
1363`boolean` values
1364
1365**Example**
1366
1367```json
1368{
1369 "terminal": {
1370 "copy_on_select": true
1371 }
1372}
1373```
1374
1375### Terminal: Env
1376
1377- 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
1378- Setting: `env`
1379- Default: `{}`
1380
1381**Example**
1382
1383```json
1384{
1385 "terminal": {
1386 "env": {
1387 "ZED": "1",
1388 "KEY": "value1:value2"
1389 }
1390 }
1391}
1392```
1393
1394### Terminal: Font Size
1395
1396- Description: What font size to use for the terminal. When not set defaults to matching the editor's font size
1397- Setting: `font_size`
1398- Default: `null`
1399
1400**Options**
1401
1402`integer` values
1403
1404```json
1405{
1406 "terminal": {
1407 "font_size": 15
1408 }
1409}
1410```
1411
1412### Terminal: Font Family
1413
1414- Description: What font to use for the terminal. When not set, defaults to matching the editor's font.
1415- Setting: `font_family`
1416- Default: `null`
1417
1418**Options**
1419
1420The name of any font family installed on the user's system
1421
1422```json
1423{
1424 "terminal": {
1425 "font_family": "Berkeley Mono"
1426 }
1427}
1428```
1429
1430### Terminal: Font Features
1431
1432- Description: What font features to use for the terminal. When not set, defaults to matching the editor's font features.
1433- Setting: `font_features`
1434- Default: `null`
1435
1436**Options**
1437
1438See Buffer Font Features
1439
1440```jsonc
1441{
1442 "terminal": {
1443 "font_features": {
1444 "calt": false,
1445 // See Buffer Font Features for more features
1446 },
1447 },
1448}
1449```
1450
1451### Terminal: Line Height
1452
1453- Description: Set the terminal's line height.
1454- Setting: `line_height`
1455- Default: `comfortable`
1456
1457**Options**
1458
14591. Use a line height that's `comfortable` for reading, 1.618. (default)
1460
1461```jsonc
1462{
1463 "terminal": {
1464 "line_height": "comfortable",
1465 },
1466}
1467```
1468
14692. Use a `standard` line height, 1.3. This option is useful for TUIs, particularly if they use box characters
1470
1471```jsonc
1472{
1473 "terminal": {
1474 "line_height": "standard",
1475 },
1476}
1477```
1478
14793. Use a custom line height.
1480
1481```jsonc
1482{
1483 "terminal": {
1484 "line_height": {
1485 "custom": 2,
1486 },
1487 },
1488}
1489```
1490
1491### Terminal: Option As Meta
1492
1493- Description: Re-interprets the option keys to act like a 'meta' key, like in Emacs.
1494- Setting: `option_as_meta`
1495- Default: `true`
1496
1497**Options**
1498
1499`boolean` values
1500
1501```json
1502{
1503 "terminal": {
1504 "option_as_meta": true
1505 }
1506}
1507```
1508
1509### Terminal: Shell
1510
1511- Description: What shell to use when launching the terminal.
1512- Setting: `shell`
1513- Default: `system`
1514
1515**Options**
1516
15171. Use the system's default terminal configuration (usually the `/etc/passwd` file).
1518
1519```json
1520{
1521 "terminal": {
1522 "shell": "system"
1523 }
1524}
1525```
1526
15272. A program to launch:
1528
1529```json
1530{
1531 "terminal": {
1532 "shell": {
1533 "program": "sh"
1534 }
1535 }
1536}
1537```
1538
15393. A program with arguments:
1540
1541```json
1542{
1543 "terminal": {
1544 "shell": {
1545 "with_arguments": {
1546 "program": "/bin/bash",
1547 "args": ["--login"]
1548 }
1549 }
1550 }
1551}
1552```
1553
1554## Terminal: Toolbar
1555
1556- Description: Whether or not to show various elements in the terminal toolbar. It only affects terminals placed in the editor pane.
1557- Setting: `toolbar`
1558- Default:
1559
1560```json
1561{
1562 "terminal": {
1563 "toolbar": {
1564 "title": true
1565 }
1566 }
1567}
1568```
1569
1570**Options**
1571
1572At 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.
1573
1574### Terminal: Button
1575
1576- Description: Control to show or hide the terminal button in the status bar
1577- Setting: `button`
1578- Default: `true`
1579
1580**Options**
1581
1582`boolean` values
1583
1584```json
1585{
1586 "terminal": {
1587 "button": false
1588 }
1589}
1590```
1591
1592### Terminal: Working Directory
1593
1594- Description: What working directory to use when launching the terminal.
1595- Setting: `working_directory`
1596- Default: `"current_project_directory"`
1597
1598**Options**
1599
16001. Use the current file's project directory. Will Fallback to the first project directory strategy if unsuccessful
1601
1602```json
1603{
1604 "terminal": {
1605 "working_directory": "current_project_directory"
1606 }
1607}
1608```
1609
16102. Use the first project in this workspace's directory. Will fallback to using this platform's home directory.
1611
1612```json
1613{
1614 "terminal": {
1615 "working_directory": "first_project_directory"
1616 }
1617}
1618```
1619
16203. Always use this platform's home directory (if we can find it)
1621
1622```json
1623{
1624 "terminal": {
1625 "working_directory": "always_home"
1626 }
1627}
1628```
1629
16304. 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.
1631
1632```json
1633{
1634 "terminal": {
1635 "working_directory": {
1636 "always": {
1637 "directory": "~/zed/projects/"
1638 }
1639 }
1640 }
1641}
1642```
1643
1644## Theme
1645
1646- 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.
1647- Setting: `theme`
1648- Default: `One Dark`
1649
1650### Theme Object
1651
1652- Description: Specify the theme using an object that includes the `mode`, `dark`, and `light` themes.
1653- Setting: `theme`
1654- Default:
1655
1656```json
1657"theme": {
1658 "mode": "system",
1659 "dark": "One Dark",
1660 "light": "One Light"
1661},
1662```
1663
1664### Mode
1665
1666- Description: Specify theme mode.
1667- Setting: `mode`
1668- Default: `system`
1669
1670**Options**
1671
16721. Set the theme to dark mode
1673
1674```json
1675{
1676 "mode": "dark"
1677}
1678```
1679
16802. Set the theme to light mode
1681
1682```json
1683{
1684 "mode": "light"
1685}
1686```
1687
16883. Set the theme to system mode
1689
1690```json
1691{
1692 "mode": "system"
1693}
1694```
1695
1696### Dark
1697
1698- Description: The name of the dark Zed theme to use for the UI.
1699- Setting: `dark`
1700- Default: `One Dark`
1701
1702**Options**
1703
1704Run the `theme selector: toggle` action in the command palette to see a current list of valid themes names.
1705
1706### Light
1707
1708- Description: The name of the light Zed theme to use for the UI.
1709- Setting: `light`
1710- Default: `One Light`
1711
1712**Options**
1713
1714Run the `theme selector: toggle` action in the command palette to see a current list of valid themes names.
1715
1716## Vim
1717
1718- Description: Whether or not to enable vim mode (work in progress).
1719- Setting: `vim_mode`
1720- Default: `false`
1721
1722## Project Panel
1723
1724- Description: Customize project panel
1725- Setting: `project_panel`
1726- Default:
1727
1728```json
1729{
1730 "project_panel": {
1731 "button": true,
1732 "default_width": 240,
1733 "dock": "left",
1734 "file_icons": true,
1735 "folder_icons": true,
1736 "git_status": true,
1737 "indent_size": 20,
1738 "auto_reveal_entries": true,
1739 "auto_fold_dirs": true,
1740 "scrollbar": {
1741 "show": "always"
1742 }
1743 }
1744}
1745```
1746
1747### Dock
1748
1749- Description: Control the position of the dock
1750- Setting: `dock`
1751- Default: `left`
1752
1753**Options**
1754
17551. Default dock position to left
1756
1757```json
1758{
1759 "dock": "left"
1760}
1761```
1762
17632. Default dock position to right
1764
1765```json
1766{
1767 "dock": "right"
1768}
1769```
1770
1771### Git Status
1772
1773- Description: Indicates newly created and updated files
1774- Setting: `git_status`
1775- Default: `true`
1776
1777**Options**
1778
17791. Default enable git status
1780
1781```json
1782{
1783 "git_status": true
1784}
1785```
1786
17872. Default disable git status
1788
1789```json
1790{
1791 "git_status": false
1792}
1793```
1794
1795### Default Width
1796
1797- Description: Customize default width taken by project panel
1798- Setting: `default_width`
1799- Default: N/A width in pixels (eg: 420)
1800
1801**Options**
1802
1803`boolean` values
1804
1805### Auto Reveal Entries
1806
1807- Description: Whether to reveal it in the project panel automatically, when a corresponding project entry becomes active. Gitignored entries are never auto revealed.
1808- Setting: `auto_reveal_entries`
1809- Default: `true`
1810
1811**Options**
1812
18131. Enable auto reveal entries
1814
1815```json
1816{
1817 "auto_reveal_entries": true
1818}
1819```
1820
18212. Disable auto reveal entries
1822
1823```json
1824{
1825 "auto_reveal_entries": false
1826}
1827```
1828
1829### Auto Fold Dirs
1830
1831- Description: Whether to fold directories automatically when directory has only one directory inside.
1832- Setting: `auto_fold_dirs`
1833- Default: `true`
1834
1835**Options**
1836
18371. Enable auto fold dirs
1838
1839```json
1840{
1841 "auto_fold_dirs": true
1842}
1843```
1844
18452. Disable auto fold dirs
1846
1847```json
1848{
1849 "auto_fold_dirs": false
1850}
1851```
1852
1853### Indent Size
1854
1855- Description: Amount of indentation (in pixels) for nested items.
1856- Setting: `indent_size`
1857- Default: `20`
1858
1859### Scrollbar
1860
1861- Description: Scrollbar related settings. Possible values: "always", "never".
1862- Setting: `scrollbar`
1863- Default:
1864
1865```json
1866"scrollbar": {
1867 "show": "always"
1868}
1869```
1870
1871**Options**
1872
18731. Show scrollbar in project panel
1874
1875```json
1876{
1877 "scrollbar": {
1878 "show": "always"
1879 }
1880}
1881```
1882
18832. Hide scrollbar in project panel
1884
1885```json
1886{
1887 "scrollbar": {
1888 "show": "never"
1889 }
1890}
1891```
1892
1893## Assistant Panel
1894
1895- Description: Customize assistant panel
1896- Setting: `assistant`
1897- Default:
1898
1899```json
1900"assistant": {
1901 "enabled": true,
1902 "button": true,
1903 "dock": "right",
1904 "default_width": 640,
1905 "default_height": 320,
1906 "provider": "openai",
1907 "version": "1",
1908},
1909```
1910
1911## Outline Panel
1912
1913- Description: Customize outline Panel
1914- Setting: `outline_panel`
1915- Default:
1916
1917```json
1918"outline_panel": {
1919 "button": true,
1920 "default_width": 240,
1921 "dock": "left",
1922 "file_icons": true,
1923 "folder_icons": true,
1924 "git_status": true,
1925 "indent_size": 20,
1926 "auto_reveal_entries": true,
1927 "auto_fold_dirs": true,
1928}
1929```
1930
1931## Calls
1932
1933- Description: Customize behavior when participating in a call
1934- Setting: `calls`
1935- Default:
1936
1937```json
1938"calls": {
1939 // Join calls with the microphone live by default
1940 "mute_on_join": false,
1941 // Share your project when you are the first to join a channel
1942 "share_on_join": false
1943},
1944```
1945
1946## Unnecessary Code Fade
1947
1948- Description: How much to fade out unused code.
1949- Setting: `unnecessary_code_fade`
1950- Default: `0.3`
1951
1952**Options**
1953
1954Float values between `0.0` and `0.9`, where:
1955
1956- `0.0` means no fading (unused code looks the same as used code)
1957- `0.9` means maximum fading (unused code is very faint but still visible)
1958
1959**Example**
1960
1961```json
1962{
1963 "unnecessary_code_fade": 0.5
1964}
1965```
1966
1967## An example configuration:
1968
1969```json
1970// ~/.config/zed/settings.json
1971{
1972 "theme": "cave-light",
1973 "tab_size": 2,
1974 "preferred_line_length": 80,
1975 "soft_wrap": "none",
1976
1977 "buffer_font_size": 18,
1978 "buffer_font_family": "Zed Plex Mono",
1979
1980 "autosave": "on_focus_change",
1981 "format_on_save": "off",
1982 "vim_mode": false,
1983 "projects_online_by_default": true,
1984 "terminal": {
1985 "font_family": "FiraCode Nerd Font Mono",
1986 "blinking": "off"
1987 },
1988 "languages": {
1989 "C": {
1990 "format_on_save": "language_server",
1991 "preferred_line_length": 64,
1992 "soft_wrap": "preferred_line_length"
1993 }
1994 }
1995}
1996```