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