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- `copilot`
  10- `enable_language_server`
  11- `ensure_final_newline_on_save`
  12- `format_on_save`
  13- `formatter`
  14- `hard_tabs`
  15- `languages`
  16- `preferred_line_length`
  17- `remove_trailing_whitespace_on_save`
  18- `soft_wrap`
  19- `tab_size`
  20- `show_copilot_suggestions`
  21- `show_whitespaces`
  22
  23_See the Global settings section for details about these settings_
  24
  25## Global settings
  26
  27To get started with editing Zed's global settings, open `~/.config/zed/settings.json` via `⌘` + `,`, the command palette (`zed: open settings`), or the `Zed > Settings > Open Settings` application menu item.
  28
  29Here are all the currently available settings.
  30
  31## Active Pane Magnification
  32
  33- Description: Scale by which to zoom the active pane. When set to `1.0`, the active pane has the same size as others, but when set to a larger value, the active pane takes up more space.
  34- Setting: `active_pane_magnification`
  35- Default: `1.0`
  36
  37**Options**
  38
  39`float` values
  40
  41## Autosave
  42
  43- Description: When to automatically save edited buffers.
  44- Setting: `autosave`
  45- Default: `off`
  46
  47**Options**
  48
  491. To disable autosave, set it to `off`
  50
  51```json
  52{
  53  "autosave": "off"
  54}
  55```
  56
  572. To autosave when focus changes, use `on_focus_change`:
  58
  59```json
  60{
  61  "autosave": "on_focus_change"
  62}
  63```
  64
  653. To autosave when the active window changes, use `on_window_change`:
  66
  67```json
  68{
  69  "autosave": "on_window_change"
  70}
  71```
  72
  734. To autosave after an inactivity period, use `after_delay`:
  74
  75```json
  76{
  77  "autosave": {
  78    "after_delay": {
  79      "milliseconds": 1000
  80    }
  81  }
  82}
  83```
  84
  85## Auto Update
  86
  87- Description: Whether or not to automatically check for updates.
  88- Setting: `auto_update`
  89- Default: `true`
  90
  91**Options**
  92
  93`boolean` values
  94
  95## Buffer Font Family
  96
  97- Description: The name of a font to use for rendering text in the editor.
  98- Setting: `buffer_font_family`
  99- Default: `Zed Mono`
 100
 101**Options**
 102
 103The name of any font family installed on the user's system
 104
 105## Buffer Font Features
 106
 107- Description: The OpenType features to enable for text in the editor.
 108- Setting: `buffer_font_features`
 109- Default: `null`
 110
 111**Options**
 112
 113Zed supports 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## Copilot
 165
 166- Description: Copilot-specific settings.
 167- Setting: `copilot`
 168- Default:
 169
 170```json
 171"copilot": {
 172  "disabled_globs": [
 173    ".env"
 174  ]
 175}
 176```
 177
 178**Options**
 179
 180### Disabled Globs
 181
 182- Description: The set of glob patterns for which Copilot should be disabled in any matching file.
 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    "coloring": "fixed",
 729    "background_coloring": "disabled"
 730  }
 731}
 732```
 733
 734**Options**
 735
 7361. Disable indent guides
 737
 738```json
 739{
 740  "indent_guides": {
 741    "enabled": false
 742  }
 743}
 744```
 745
 7462. Enable indent guides for a specific language.
 747
 748```json
 749{
 750  "languages": {
 751    "Python": {
 752      "indent_guides": {
 753        "enabled": true
 754      }
 755    }
 756  }
 757}
 758```
 759
 7603. Enable indent aware coloring ("rainbow indentation").
 761The colors that are used for different indentation levels are defined in the theme (theme key: `accents`). They can be customized by using theme overrides.
 762
 763```json
 764{
 765  "indent_guides": {
 766    "enabled": true,
 767    "coloring": "indent_aware"
 768  }
 769}
 770```
 771
 7724. Enable indent aware background coloring ("rainbow indentation").
 773The colors that are used for different indentation levels are defined in the theme (theme key: `accents`). They can be customized by using theme overrides.
 774
 775```json
 776{
 777  "indent_guides": {
 778    "enabled": true,
 779    "coloring": "indent_aware",
 780    "background_coloring": "indent_aware"
 781  }
 782}
 783```
 784
 785### Inline Git Blame
 786
 787- Description: Whether or not to show git blame information inline, on the currently focused line (requires Zed `0.132.0`).
 788- Setting: `inline_blame`
 789- Default:
 790
 791```json
 792{
 793  "git": {
 794    "inline_blame": {
 795      "enabled": true
 796    }
 797  }
 798}
 799```
 800
 801**Options**
 802
 8031. Disable inline git blame:
 804
 805```json
 806{
 807  "git": {
 808    "inline_blame": {
 809      "enabled": false
 810    }
 811  }
 812}
 813```
 814
 8152. Only show inline git blame after a delay (that starts after cursor stops moving):
 816
 817```json
 818{
 819  "git": {
 820    "inline_blame": {
 821      "enabled": false,
 822      "delay_ms": 500
 823    }
 824  }
 825}
 826```
 827
 828## Hard Tabs
 829
 830- Description: Whether to indent lines using tab characters or multiple spaces.
 831- Setting: `hard_tabs`
 832- Default: `false`
 833
 834**Options**
 835
 836`boolean` values
 837
 838## Hover Popover Enabled
 839
 840- Description: Whether or not to show the informational hover box when moving the mouse over symbols in the editor.
 841- Setting: `hover_popover_enabled`
 842- Default: `true`
 843
 844**Options**
 845
 846`boolean` values
 847
 848## Inlay hints
 849
 850- Description: Configuration for displaying extra text with hints in the editor.
 851- Setting: `inlay_hints`
 852- Default:
 853
 854```json
 855"inlay_hints": {
 856  "enabled": false,
 857  "show_type_hints": true,
 858  "show_parameter_hints": true,
 859  "show_other_hints": true,
 860  "edit_debounce_ms": 700,
 861  "scroll_debounce_ms": 50
 862}
 863```
 864
 865**Options**
 866
 867Inlay hints querying consists of two parts: editor (client) and LSP server.
 868With 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.
 869At 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.
 870
 871The following languages have inlay hints preconfigured by Zed:
 872
 873- [Go](https://docs.zed.dev/languages/go)
 874- [Rust](https://docs.zed.dev/languages/rust)
 875- [Svelte](https://docs.zed.dev/languages/svelte)
 876- [Typescript](https://docs.zed.dev/languages/typescript)
 877
 878Use the `lsp` section for the server configuration. Examples are provided in the corresponding language documentation.
 879
 880Hints are not instantly queried in Zed, two kinds of debounces are used, either may be set to 0 to be disabled.
 881Settings-related hint updates are not debounced.
 882
 883## Journal
 884
 885- Description: Configuration for the journal.
 886- Setting: `journal`
 887- Default:
 888
 889```json
 890"journal": {
 891  "path": "~",
 892  "hour_format": "hour12"
 893}
 894```
 895
 896### Path
 897
 898- Description: The path of the directory where journal entries are stored.
 899- Setting: `path`
 900- Default: `~`
 901
 902**Options**
 903
 904`string` values
 905
 906### Hour Format
 907
 908- Description: The format to use for displaying hours in the journal.
 909- Setting: `hour_format`
 910- Default: `hour12`
 911
 912**Options**
 913
 9141. 12-hour format:
 915
 916```json
 917{
 918  "hour_format": "hour12"
 919}
 920```
 921
 9222. 24-hour format:
 923
 924```json
 925{
 926  "hour_format": "hour24"
 927}
 928```
 929
 930## Languages
 931
 932- Description: Configuration for specific languages.
 933- Setting: `languages`
 934- Default: `null`
 935
 936**Options**
 937
 938To override settings for a language, add an entry for that languages name to the `languages` value. Example:
 939
 940```json
 941"languages": {
 942  "C": {
 943    "format_on_save": "off",
 944    "preferred_line_length": 64,
 945    "soft_wrap": "preferred_line_length"
 946  },
 947  "JSON": {
 948    "tab_size": 4
 949  }
 950}
 951```
 952
 953The following settings can be overridden for each specific language:
 954
 955- `enable_language_server`
 956- `ensure_final_newline_on_save`
 957- `format_on_save`
 958- `formatter`
 959- `hard_tabs`
 960- `preferred_line_length`
 961- `remove_trailing_whitespace_on_save`
 962- `show_copilot_suggestions`
 963- `show_whitespaces`
 964- `soft_wrap`
 965- `tab_size`
 966- `use_autoclose`
 967- `always_treat_brackets_as_autoclosed`
 968
 969These values take in the same options as the root-level settings with the same name.
 970
 971## Preview tabs
 972
 973- Description:
 974  (requires Zed `0.132.x`) \
 975  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. \
 976   There are several ways to convert a preview tab into a regular tab:
 977
 978  - Double-clicking on the file
 979  - Double-clicking on the tab header
 980  - Using the `project_panel::OpenPermanent` action
 981  - Editing the file
 982  - Dragging the file to a different pane
 983
 984- Setting: `preview_tabs`
 985- Default:
 986
 987```json
 988"preview_tabs": {
 989  "enabled": true,
 990  "enable_preview_from_file_finder": false,
 991  "enable_preview_from_code_navigation": false,
 992}
 993```
 994
 995### Enable preview from file finder
 996
 997- Description: Determines whether to open files in preview mode when selected from the file finder.
 998- Setting: `enable_preview_from_file_finder`
 999- Default: `false`
1000
1001**Options**
1002
1003`boolean` values
1004
1005### Enable preview from code navigation
1006
1007- Description: Determines whether a preview tab gets replaced when code navigation is used to navigate away from the tab (requires Zed `0.134.x`).
1008- Setting: `enable_preview_from_code_navigation`
1009- Default: `false`
1010
1011**Options**
1012
1013`boolean` values
1014
1015## Preferred Line Length
1016
1017- Description: The column at which to soft-wrap lines, for buffers where soft-wrap is enabled.
1018- Setting: `preferred_line_length`
1019- Default: `80`
1020
1021**Options**
1022
1023`integer` values
1024
1025## Projects Online By Default
1026
1027- Description: Whether or not to show the online projects view by default.
1028- Setting: `projects_online_by_default`
1029- Default: `true`
1030
1031**Options**
1032
1033`boolean` values
1034
1035## Remove Trailing Whitespace On Save
1036
1037- Description: Whether or not to remove any trailing whitespace from lines of a buffer before saving it.
1038- Setting: `remove_trailing_whitespace_on_save`
1039- Default: `true`
1040
1041**Options**
1042
1043`boolean` values
1044
1045## Show Call Status Icon
1046
1047- Description: Whether or not to show the call status icon in the status bar.
1048- Setting: `show_call_status_icon`
1049- Default: `true`
1050
1051**Options**
1052
1053`boolean` values
1054
1055## Show Completions On Input
1056
1057- Description: Whether or not to show completions as you type.
1058- Setting: `show_completions_on_input`
1059- Default: `true`
1060
1061**Options**
1062
1063`boolean` values
1064
1065## Show Completion Documentation
1066
1067- Description: Whether to display inline and alongside documentation for items in the completions menu.
1068- Setting: `show_completion_documentation`
1069- Default: `true`
1070
1071**Options**
1072
1073`boolean` values
1074
1075## Completion Documentation Debounce Delay
1076
1077- Description: The debounce delay before re-querying the language server for completion documentation when not included in original completion list.
1078- Setting: `completion_documentation_secondary_query_debounce`
1079- Default: `300` ms
1080
1081**Options**
1082
1083`integer` values
1084
1085## Show Copilot Suggestions
1086
1087- Description: Whether or not to show Copilot suggestions as you type or wait for a `copilot::Toggle`.
1088- Setting: `show_copilot_suggestions`
1089- Default: `true`
1090
1091**Options**
1092
1093`boolean` values
1094
1095## Show Whitespaces
1096
1097- Description: Whether or not to show render whitespace characters in the editor.
1098- Setting: `show_whitespaces`
1099- Default: `selection`
1100
1101**Options**
1102
11031. `all`
11042. `selection`
11053. `none`
1106
1107## Soft Wrap
1108
1109- Description: Whether or not to automatically wrap lines of text to fit editor / preferred width.
1110- Setting: `soft_wrap`
1111- Default: `none`
1112
1113**Options**
1114
11151. `editor_width`
11162. `preferred_line_length`
11173. `none`
1118
1119## Tab Size
1120
1121- Description: The number of spaces to use for each tab character.
1122- Setting: `tab_size`
1123- Default: `4`
1124
1125**Options**
1126
1127`integer` values
1128
1129## Telemetry
1130
1131- Description: Control what info is collected by Zed.
1132- Setting: `telemetry`
1133- Default:
1134
1135```json
1136"telemetry": {
1137  "diagnostics": true,
1138  "metrics": true
1139},
1140```
1141
1142**Options**
1143
1144### Diagnostics
1145
1146- Description: Setting for sending debug-related data, such as crash reports.
1147- Setting: `diagnostics`
1148- Default: `true`
1149
1150**Options**
1151
1152`boolean` values
1153
1154### Metrics
1155
1156- Description: Setting for sending anonymized usage data, such what languages you're using Zed with.
1157- Setting: `metrics`
1158- Default: `true`
1159
1160**Options**
1161
1162`boolean` values
1163
1164## Terminal
1165
1166- Description: Configuration for the terminal.
1167- Setting: `terminal`
1168- Default:
1169
1170```json
1171"terminal": {
1172  "alternate_scroll": "off",
1173  "blinking": "terminal_controlled",
1174  "copy_on_select": false,
1175  "env": {},
1176  "font_family": null,
1177  "font_features": null,
1178  "font_size": null,
1179  "option_as_meta": false,
1180  "button": false,
1181  "shell": {},
1182  "toolbar": {
1183    "title": true
1184  },
1185  "working_directory": "current_project_directory"
1186}
1187```
1188
1189### Alternate Scroll
1190
1191- 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.
1192- Setting: `alternate_scroll`
1193- Default: `off`
1194
1195**Options**
1196
11971. Default alternate scroll mode to on
1198
1199```json
1200{
1201  "alternate_scroll": "on"
1202}
1203```
1204
12052. Default alternate scroll mode to off
1206
1207```json
1208{
1209  "alternate_scroll": "off"
1210}
1211```
1212
1213### Blinking
1214
1215- Description: Set the cursor blinking behavior in the terminal
1216- Setting: `blinking`
1217- Default: `terminal_controlled`
1218
1219**Options**
1220
12211. Never blink the cursor, ignore the terminal mode
1222
1223```json
1224{
1225  "blinking": "off"
1226}
1227```
1228
12292. Default the cursor blink to off, but allow the terminal to turn blinking on
1230
1231```json
1232{
1233  "blinking": "terminal_controlled"
1234}
1235```
1236
12373. Always blink the cursor, ignore the terminal mode
1238
1239```json
1240"blinking": "on",
1241```
1242
1243### Copy On Select
1244
1245- Description: Whether or not selecting text in the terminal will automatically copy to the system clipboard.
1246- Setting: `copy_on_select`
1247- Default: `false`
1248
1249**Options**
1250
1251`boolean` values
1252
1253### Env
1254
1255- 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
1256- Setting: `env`
1257- Default: `{}`
1258
1259**Example**
1260
1261```json
1262"env": {
1263  "ZED": "1",
1264  "KEY": "value1:value2"
1265}
1266```
1267
1268### Font Size
1269
1270- Description: What font size to use for the terminal. When not set defaults to matching the editor's font size
1271- Setting: `font_size`
1272- Default: `null`
1273
1274**Options**
1275
1276`integer` values
1277
1278### Font Family
1279
1280- Description: What font to use for the terminal. When not set, defaults to matching the editor's font.
1281- Setting: `font_family`
1282- Default: `null`
1283
1284**Options**
1285
1286The name of any font family installed on the user's system
1287
1288### Font Features
1289
1290- Description: What font features to use for the terminal. When not set, defaults to matching the editor's font features.
1291- Setting: `font_features`
1292- Default: `null`
1293
1294**Options**
1295
1296See Buffer Font Features
1297
1298### Option As Meta
1299
1300- Description: Re-interprets the option keys to act like a 'meta' key, like in Emacs.
1301- Setting: `option_as_meta`
1302- Default: `true`
1303
1304**Options**
1305
1306`boolean` values
1307
1308### Shell
1309
1310- Description: What shell to use when launching the terminal.
1311- Setting: `shell`
1312- Default: `system`
1313
1314**Options**
1315
13161. Use the system's default terminal configuration (usually the `/etc/passwd` file).
1317
1318```json
1319{
1320  "shell": "system"
1321}
1322```
1323
13242. A program to launch:
1325
1326```json
1327"shell": {
1328    "program": "sh"
1329}
1330```
1331
13323. A program with arguments:
1333
1334```json
1335"shell": {
1336  "with_arguments": {
1337    "program": "/bin/bash",
1338    "args": ["--login"]
1339  }
1340}
1341```
1342
1343## Terminal Toolbar
1344
1345- Description: Whether or not to show various elements in the terminal toolbar. It only affects terminals placed in the editor pane.
1346- Setting: `toolbar`
1347- Default:
1348
1349```json
1350"toolbar": {
1351  "title": true,
1352},
1353```
1354
1355**Options**
1356
1357At 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.
1358
1359### Terminal Button
1360
1361- Description: Control to show or hide the terminal button in the status bar
1362- Setting: `button`
1363- Default: `true`
1364
1365**Options**
1366
1367`boolean` values
1368
1369### Working Directory
1370
1371- Description: What working directory to use when launching the terminal.
1372- Setting: `working_directory`
1373- Default: `"current_project_directory"`
1374
1375**Options**
1376
13771. Use the current file's project directory. Will Fallback to the first project directory strategy if unsuccessful
1378
1379```json
1380{
1381  "working_directory": "current_project_directory"
1382}
1383```
1384
13852. Use the first project in this workspace's directory. Will fallback to using this platform's home directory.
1386
1387```json
1388{
1389  "working_directory": "first_project_directory"
1390}
1391```
1392
13933. Always use this platform's home directory (if we can find it)
1394
1395```json
1396{
1397  "working_directory": "always_home"
1398}
1399```
1400
14014. 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.
1402
1403```json
1404"working_directory": {
1405  "always": {
1406    "directory": "~/zed/projects/"
1407  }
1408}
1409```
1410
1411## Theme
1412
1413- 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.
1414- Setting: `theme`
1415- Default: `One Dark`
1416
1417### Theme Object
1418
1419- Description: Specify the theme using an object that includes the `mode`, `dark`, and `light` themes.
1420- Setting: `theme`
1421- Default:
1422
1423```json
1424"theme": {
1425  "mode": "dark",
1426  "dark": "One Dark",
1427  "light": "One Light"
1428},
1429```
1430
1431### Mode
1432
1433- Description: Specify theme mode.
1434- Setting: `mode`
1435- Default: `dark`
1436
1437**Options**
1438
14391. Set the theme to dark mode
1440
1441```json
1442{
1443  "mode": "dark"
1444}
1445```
1446
14472. Set the theme to light mode
1448
1449```json
1450{
1451  "mode": "light"
1452}
1453```
1454
14553. Set the theme to system mode
1456
1457```json
1458{
1459  "mode": "system"
1460}
1461```
1462
1463### Dark
1464
1465- Description: The name of the dark Zed theme to use for the UI.
1466- Setting: `dark`
1467- Default: `One Dark`
1468
1469**Options**
1470
1471Run the `theme selector: toggle` action in the command palette to see a current list of valid themes names.
1472
1473### Light
1474
1475- Description: The name of the light Zed theme to use for the UI.
1476- Setting: `light`
1477- Default: `One Light`
1478
1479**Options**
1480
1481Run the `theme selector: toggle` action in the command palette to see a current list of valid themes names.
1482
1483## Vim
1484
1485- Description: Whether or not to enable vim mode (work in progress).
1486- Setting: `vim_mode`
1487- Default: `false`
1488
1489## Project Panel
1490
1491- Description: Customise project panel
1492- Setting: `project_panel`
1493- Default:
1494
1495```json
1496"project_panel": {
1497  "button": true,
1498  "dock": "left",
1499  "git_status": true,
1500  "default_width": "N/A - width in pixels"
1501},
1502```
1503
1504### Dock
1505
1506- Description: Control the position of the dock
1507- Setting: `dock`
1508- Default: `left`
1509
1510**Options**
1511
15121. Default dock position to left
1513
1514```json
1515{
1516  "dock": "left"
1517}
1518```
1519
15202. Default dock position to right
1521
1522```json
1523{
1524  "dock": "right"
1525}
1526```
1527
1528### Git Status
1529
1530- Description: Indicates newly created and updated files
1531- Setting: `git_status`
1532- Default: `true`
1533
15341. Default enable git status
1535
1536```json
1537{
1538  "git_status": true
1539}
1540```
1541
15422. Default disable git status
1543
1544```json
1545{
1546  "git_status": false
1547}
1548```
1549
1550### Default Width
1551
1552- Description: Customise default width taken by project panel
1553- Setting: `default_width`
1554- Default: N/A width in pixels (eg: 420)
1555
1556**Options**
1557
1558`boolean` values
1559
1560## Calls
1561
1562- Description: Customise behaviour when participating in a call
1563- Setting: `calls`
1564- Default:
1565
1566```json
1567"calls": {
1568  // Join calls with the microphone live by default
1569  "mute_on_join": false,
1570  // Share your project when you are the first to join a channel
1571  "share_on_join": false
1572},
1573```
1574
1575## An example configuration:
1576
1577```json
1578// ~/.config/zed/settings.json
1579{
1580  "theme": "cave-light",
1581  "tab_size": 2,
1582  "preferred_line_length": 80,
1583  "soft_wrap": "none",
1584
1585  "buffer_font_size": 18,
1586  "buffer_font_family": "Zed Mono",
1587
1588  "autosave": "on_focus_change",
1589  "format_on_save": "off",
1590  "vim_mode": false,
1591  "projects_online_by_default": true,
1592  "terminal": {
1593    "font_family": "FiraCode Nerd Font Mono",
1594    "blinking": "off"
1595  },
1596  "languages": {
1597    "C": {
1598      "format_on_save": "language_server",
1599      "preferred_line_length": 64,
1600      "soft_wrap": "preferred_line_length"
1601    }
1602  }
1603}
1604```