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