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