configuring-zed.md

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