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