configuring-zed.md

   1# Configuring Zed
   2
   3Zed is designed to be configured: we want to fit your workflow and preferences exactly. We provide default settings that are designed to be a comfortable starting point for as many people as possible, but we hope you will enjoy tweaking it to make it feel incredible.
   4
   5In addition to the settings described here, you may also want to change your [theme](./themes.md), configure your [key bindings](./key-bindings.md), set up [tasks](./tasks.md) or install [extensions](https://github.com/zed-industries/extensions).
   6
   7## Settings files
   8
   9Your settings file can be opened with `cmd-,` (on macOS) or `ctrl-,` (on Linux). By default it is located at `~/.config/zed/settings.json`, though if you have XDG_CONFIG_HOME in your environment on Linux it will be at `$XDG_CONFIG_HOME/zed/settings.json` instead.
  10
  11This configuration is merged with any local configuration inside your projects. You can open the project settings by running `zed: Open Local Settings` from the command palette. This will create a `.zed` directory containing`.zed/settings.json`.
  12
  13Although most projects will only need one settings file at the root, you can add more local settings files for subdirectories as needed. Not all settings can be set in local files, just those that impact the behaviour of the editor and language tooling. For example you can set `tab_size`, `formatter` etc. but not `theme`, `vim_mode` and similar.
  14
  15The syntax for configuration files is a super-set of JSON that allows `//` comments.
  16
  17## Default settings
  18
  19You can find the default settings for your current Zed by running `zed: Open Default Settings` from the command palette.
  20
  21Extensions that provide language servers may also provide default settings for those language servers.
  22
  23# Settings
  24
  25## Active Pane Magnification
  26
  27- 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.
  28- Setting: `active_pane_magnification`
  29- Default: `1.0`
  30
  31**Options**
  32
  33`float` values
  34
  35## Autosave
  36
  37- Description: When to automatically save edited buffers.
  38- Setting: `autosave`
  39- Default: `off`
  40
  41**Options**
  42
  431. To disable autosave, set it to `off`:
  44
  45```json
  46{
  47  "autosave": "off"
  48}
  49```
  50
  512. To autosave when focus changes, use `on_focus_change`:
  52
  53```json
  54{
  55  "autosave": "on_focus_change"
  56}
  57```
  58
  593. To autosave when the active window changes, use `on_window_change`:
  60
  61```json
  62{
  63  "autosave": "on_window_change"
  64}
  65```
  66
  674. To autosave after an inactivity period, use `after_delay`:
  68
  69```json
  70{
  71  "autosave": {
  72    "after_delay": {
  73      "milliseconds": 1000
  74    }
  75  }
  76}
  77```
  78
  79## Auto Update
  80
  81- Description: Whether or not to automatically check for updates.
  82- Setting: `auto_update`
  83- Default: `true`
  84
  85**Options**
  86
  87`boolean` values
  88
  89## Buffer Font Family
  90
  91- Description: The name of a font to use for rendering text in the editor.
  92- Setting: `buffer_font_family`
  93- Default: `Zed Plex Mono`
  94
  95**Options**
  96
  97The name of any font family installed on the user's system
  98
  99## Buffer Font Features
 100
 101- Description: The OpenType features to enable for text in the editor.
 102- Setting: `buffer_font_features`
 103- Default: `null`
 104
 105**Options**
 106
 107Zed 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.
 108
 109For example, to disable font ligatures, add the following to your settings:
 110
 111```json
 112{
 113  "buffer_font_features": {
 114    "calt": false
 115  }
 116}
 117```
 118
 119You can also set other OpenType features, like setting `cv01` to `7`:
 120
 121```json
 122{
 123  "buffer_font_features": {
 124    "cv01": 7
 125  }
 126}
 127```
 128
 129## Buffer Font Size
 130
 131- Description: The default font size for text in the editor.
 132- Setting: `buffer_font_size`
 133- Default: `15`
 134
 135**Options**
 136
 137`integer` values
 138
 139## Buffer Font Weight
 140
 141- Description: The default font weight for text in the editor.
 142- Setting: `buffer_font_weight`
 143- Default: `400`
 144
 145**Options**
 146
 147`integer` values between `100` and `900`
 148
 149## Buffer Line Height
 150
 151- Description: The default line height for text in the editor.
 152- Setting: `buffer_line_height`
 153- Default: `"comfortable"`
 154
 155**Options**
 156
 157`"standard"`, `"comfortable"` or `{"custom": float}` (`1` is very compact, `2` very loose)
 158
 159## Confirm Quit
 160
 161- Description: Whether or not to prompt the user to confirm before closing the application.
 162- Setting: `confirm_quit`
 163- Default: `false`
 164
 165**Options**
 166
 167`boolean` values
 168
 169## Centered Layout
 170
 171- Description: Configuration for the centered layout mode.
 172- Setting: `centered_layout`
 173- Default:
 174
 175```json
 176"centered_layout": {
 177  "left_padding": 0.2,
 178  "right_padding": 0.2,
 179}
 180```
 181
 182**Options**
 183
 184The `left_padding` and `right_padding` options define the relative width of the
 185left 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`.
 186
 187## Direnv Integration
 188
 189- Description: Settings for [direnv](https://direnv.net/) integration. Requires `direnv` to be installed. `direnv` integration currently only means that the environment variables set by a `direnv` configuration can be used to detect some language servers in `$PATH` instead of installing them.
 190- Setting: `load_direnv`
 191- Default:
 192
 193```json
 194"load_direnv": "shell_hook"
 195```
 196
 197**Options**
 198There are two options to choose from:
 199
 2001. `shell_hook`: Use the shell hook to load direnv. This relies on direnv to activate upon entering the directory. Supports POSIX shells and fish.
 2012. `direct`: Use `direnv export json` to load direnv. This will load direnv directly without relying on the shell hook and might cause some inconsistencies. This allows direnv to work with any shell.
 202
 203## Inline Completions
 204
 205- Description: Settings for inline completions.
 206- Setting: `inline_completions`
 207- Default:
 208
 209```json
 210"inline_completions": {
 211  "disabled_globs": [
 212    ".env"
 213  ]
 214}
 215```
 216
 217**Options**
 218
 219### Disabled Globs
 220
 221- Description: A list of globs representing files that inline completions should be disabled for.
 222- Setting: `disabled_globs`
 223- Default: [".env"]
 224
 225**Options**
 226
 227List of `string` values
 228
 229## Current Line Highlight
 230
 231- Description: How to highlight the current line in the editor.
 232- Setting: `current_line_highlight`
 233- Default: `all`
 234
 235**Options**
 236
 2371. Don't highlight the current line:
 238
 239```json
 240"current_line_highlight": "none"
 241```
 242
 2432. Highlight the gutter area:
 244
 245```json
 246"current_line_highlight": "gutter"
 247```
 248
 2493. Highlight the editor area:
 250
 251```json
 252"current_line_highlight": "line"
 253```
 254
 2554. Highlight the full line:
 256
 257```json
 258"current_line_highlight": "all"
 259```
 260
 261## Cursor Blink
 262
 263- Description: Whether or not the cursor blinks.
 264- Setting: `cursor_blink`
 265- Default: `true`
 266
 267**Options**
 268
 269`boolean` values
 270
 271## Default Dock Anchor
 272
 273- Description: The default anchor for new docks.
 274- Setting: `default_dock_anchor`
 275- Default: `bottom`
 276
 277**Options**
 278
 2791. Position the dock attached to the bottom of the workspace: `bottom`
 2802. Position the dock to the right of the workspace like a side panel: `right`
 2813. Position the dock full screen over the entire workspace: `expanded`
 282
 283## Editor Scrollbar
 284
 285- Description: Whether or not to show the editor scrollbar and various elements in it.
 286- Setting: `scrollbar`
 287- Default:
 288
 289```json
 290"scrollbar": {
 291  "show": "auto",
 292  "cursors": true,
 293  "git_diff": true,
 294  "search_results": true,
 295  "selected_symbol": true,
 296  "diagnostics": true
 297},
 298```
 299
 300### Show Mode
 301
 302- Description: When to show the editor scrollbar.
 303- Setting: `show`
 304- Default: `auto`
 305
 306**Options**
 307
 3081. Show the scrollbar if there's important information or follow the system's configured behavior:
 309
 310```json
 311"scrollbar": {
 312  "show": "auto"
 313}
 314```
 315
 3162. Match the system's configured behavior:
 317
 318```json
 319"scrollbar": {
 320  "show": "system"
 321}
 322```
 323
 3243. Always show the scrollbar:
 325
 326```json
 327"scrollbar": {
 328  "show": "always"
 329}
 330```
 331
 3324. Never show the scrollbar:
 333
 334```json
 335"scrollbar": {
 336  "show": "never"
 337}
 338```
 339
 340### Cursor Indicators
 341
 342- Description: Whether to show cursor positions in the scrollbar.
 343- Setting: `cursors`
 344- Default: `true`
 345
 346**Options**
 347
 348`boolean` values
 349
 350### Git Diff Indicators
 351
 352- Description: Whether to show git diff indicators in the scrollbar.
 353- Setting: `git_diff`
 354- Default: `true`
 355
 356**Options**
 357
 358`boolean` values
 359
 360### Search Results Indicators
 361
 362- Description: Whether to show buffer search results in the scrollbar.
 363- Setting: `search_results`
 364- Default: `true`
 365
 366**Options**
 367
 368`boolean` values
 369
 370### Selected Symbols Indicators
 371
 372- Description: Whether to show selected symbol occurrences in the scrollbar.
 373- Setting: `selected_symbol`
 374- Default: `true`
 375
 376**Options**
 377
 378`boolean` values
 379
 380### Diagnostics
 381
 382- Description: Whether to show diagnostic indicators in the scrollbar.
 383- Setting: `diagnostics`
 384- Default: `true`
 385
 386**Options**
 387
 388`boolean` values
 389
 390## Editor Tab Bar
 391
 392- Description: Settings related to the editor's tab bar.
 393- Settings: `tab_bar`
 394- Default:
 395
 396```json
 397"tab_bar": {
 398  "show": true,
 399  "show_nav_history_buttons": true
 400}
 401```
 402
 403### Show
 404
 405- Description: Whether or not to show the tab bar in the editor.
 406- Setting: `show`
 407- Default: `true`
 408
 409**Options**
 410
 411`boolean` values
 412
 413### Navigation History Buttons
 414
 415- Description: Whether or not to show the navigation history buttons.
 416- Setting: `show_nav_history_buttons`
 417- Default: `true`
 418
 419**Options**
 420
 421`boolean` values
 422
 423## Editor Tabs
 424
 425- Description: Configuration for the editor tabs.
 426- Setting: `tabs`
 427- Default:
 428
 429```json
 430"tabs": {
 431  "close_position": "right",
 432  "file_icons": false,
 433  "git_status": false
 434},
 435```
 436
 437### Close Position
 438
 439- Description: Where to display close button within a tab.
 440- Setting: `close_position`
 441- Default: `right`
 442
 443**Options**
 444
 4451. Display the close button on the right:
 446
 447```json
 448{
 449  "close_position": "right"
 450}
 451```
 452
 4532. Display the close button on the left:
 454
 455```json
 456{
 457  "close_position": "left"
 458}
 459```
 460
 461### File Icons
 462
 463- Description: Whether to show the file icon for a tab.
 464- Setting: `file_icons`
 465- Default: `false`
 466
 467### Git Status
 468
 469- Description: Whether or not to show Git file status in tab.
 470- Setting: `git_status`
 471- Default: `false`
 472
 473## Editor Toolbar
 474
 475- Description: Whether or not to show various elements in the editor toolbar.
 476- Setting: `toolbar`
 477- Default:
 478
 479```json
 480"toolbar": {
 481  "breadcrumbs": true,
 482  "quick_actions": true
 483},
 484```
 485
 486**Options**
 487
 488Each option controls displaying of a particular toolbar element. If all elements are hidden, the editor toolbar is not displayed.
 489
 490## Enable Language Server
 491
 492- Description: Whether or not to use language servers to provide code intelligence.
 493- Setting: `enable_language_server`
 494- Default: `true`
 495
 496**Options**
 497
 498`boolean` values
 499
 500## Ensure Final Newline On Save
 501
 502- Description: Whether or not to ensure there's a single newline at the end of a buffer when saving it.
 503- Setting: `ensure_final_newline_on_save`
 504- Default: `true`
 505
 506**Options**
 507
 508`boolean` values
 509
 510## LSP
 511
 512- Description: Configuration for language servers.
 513- Setting: `lsp`
 514- Default: `null`
 515
 516**Options**
 517
 518The following settings can be overridden for specific language servers:
 519
 520- `initialization_options`
 521
 522To override settings for a language, add an entry for that language server's name to the `lsp` value. Example:
 523
 524```json
 525"lsp": {
 526  "rust-analyzer": {
 527    "initialization_options": {
 528      "check": {
 529        "command": "clippy" // rust-analyzer.check.command (default: "check")
 530      }
 531    }
 532  }
 533}
 534```
 535
 536## Format On Save
 537
 538- Description: Whether or not to perform a buffer format before saving.
 539- Setting: `format_on_save`
 540- Default: `on`
 541
 542**Options**
 543
 5441. `on`, enables format on save obeying `formatter` setting:
 545
 546```json
 547{
 548  "format_on_save": "on"
 549}
 550```
 551
 5522. `off`, disables format on save:
 553
 554```json
 555{
 556  "format_on_save": "off"
 557}
 558```
 559
 560## Formatter
 561
 562- Description: How to perform a buffer format.
 563- Setting: `formatter`
 564- Default: `auto`
 565
 566**Options**
 567
 5681. To use the current language server, use `"language_server"`:
 569
 570```json
 571{
 572  "formatter": "language_server"
 573}
 574```
 575
 5762. 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):
 577
 578```json
 579{
 580  "formatter": {
 581    "external": {
 582      "command": "sed",
 583      "arguments": ["-e", "s/ *$//"]
 584    }
 585  }
 586}
 587```
 588
 5893. Or to use code actions provided by the connected language servers, use `"code_actions"` (requires Zed `0.130.x`):
 590
 591```json
 592{
 593  "formatter": {
 594    "code_actions": {
 595      // Use ESLint's --fix:
 596      "source.fixAll.eslint": true,
 597      // Organize imports on save:
 598      "source.organizeImports": true
 599    }
 600  }
 601}
 602```
 603
 6044. Or to use multiple formatters consecutively, use an array of formatters:
 605```json
 606{
 607  "formatter": [
 608    {"language_server": {"name": "rust-analyzer"}},
 609    {"external": {
 610      "command": "sed",
 611      "arguments": ["-e", "s/ *$//"]
 612    }
 613  ]
 614}
 615```
 616Here `rust-analyzer` will be used first to format the code, followed by a call of sed.
 617If any of the formatters fails, the subsequent ones will still be executed.
 618
 619## Code Actions On Format
 620
 621- Description: The code actions to perform with the primary language server when formatting the buffer.
 622- Setting: `code_actions_on_format`
 623- Default: `{}`, except for Go it's `{ "source.organizeImports": true }`
 624
 625**Examples**
 626
 6271. Organize imports on format in TypeScript and TSX buffers:
 628
 629```json
 630{
 631  "languages": {
 632    "TypeScript": {
 633      "code_actions_on_format": {
 634        "source.organizeImports": true
 635      }
 636    },
 637    "TSX": {
 638      "code_actions_on_format": {
 639        "source.organizeImports": true
 640      }
 641    }
 642  }
 643}
 644```
 645
 6462. Run ESLint `fixAll` code action when formatting (requires Zed `0.125.0`):
 647
 648```json
 649{
 650  "languages": {
 651    "JavaScript": {
 652      "code_actions_on_format": {
 653        "source.fixAll.eslint": true
 654      }
 655    }
 656  }
 657}
 658```
 659
 6603. Run only a single ESLint rule when using `fixAll` (requires Zed `0.125.0`):
 661
 662```json
 663{
 664  "languages": {
 665    "JavaScript": {
 666      "code_actions_on_format": {
 667        "source.fixAll.eslint": true
 668      }
 669    }
 670  },
 671  "lsp": {
 672    "eslint": {
 673      "settings": {
 674        "codeActionOnSave": {
 675          "rules": ["import/order"]
 676        }
 677      }
 678    }
 679  }
 680}
 681```
 682
 683## Auto close
 684
 685- Description: Whether to automatically add matching closing characters when typing opening parenthesis, bracket, brace, single or double quote characters.
 686- Setting: `use_autoclose`
 687- Default: `true`
 688
 689**Options**
 690
 691`boolean` values
 692
 693## Always Treat Brackets As Autoclosed
 694
 695- Description: Controls how the editor handles the autoclosed characters.
 696- Setting: `always_treat_brackets_as_autoclosed`
 697- Default: `false`
 698
 699**Options**
 700
 701`boolean` values
 702
 703**Example**
 704
 705If the setting is set to `true`:
 706
 7071. Enter in the editor: `)))`
 7082. Move the cursor to the start: `^)))`
 7093. Enter again: `)))`
 710
 711The result is still `)))` and not `))))))`, which is what it would be by default.
 712
 713## File Types
 714
 715- Setting: `file_types`
 716- Description: Configure how Zed selects a language for a file based on its filename or extension. Supports glob entries.
 717- Default: `{}`
 718
 719**Examples**
 720
 721To interpret all `.c` files as C++, files called `MyLockFile` as TOML and files starting with `Dockerfile` as Dockerfile:
 722
 723```json
 724{
 725  "file_types": {
 726    "C++": ["c"],
 727    "TOML": ["MyLockFile"],
 728    "Dockerfile": ["Dockerfile*"]
 729  }
 730}
 731```
 732
 733## Git
 734
 735- Description: Configuration for git-related features.
 736- Setting: `git`
 737- Default:
 738
 739```json
 740{
 741  "git": {
 742    "git_gutter": "tracked_files",
 743    "inline_blame": {
 744      "enabled": true
 745    }
 746  }
 747}
 748```
 749
 750### Git Gutter
 751
 752- Description: Whether or not to show the git gutter.
 753- Setting: `git_gutter`
 754- Default: `tracked_files`
 755
 756**Options**
 757
 7581. Show git gutter in tracked files
 759
 760```json
 761{
 762  "git": {
 763    "git_gutter": "tracked_files"
 764  }
 765}
 766```
 767
 7682. Hide git gutter
 769
 770```json
 771{
 772  "git": {
 773    "git_gutter": "hide"
 774  }
 775}
 776```
 777
 778### Indent Guides
 779
 780- Description: Configuration related to indent guides (requires Zed `0.138.0`). Indent guides can be configured separately for each language.
 781- Setting: `indent_guides`
 782- Default:
 783
 784```json
 785{
 786  "indent_guides": {
 787    "enabled": true,
 788    "line_width": 1,
 789    "active_line_width": 1,
 790    "coloring": "fixed",
 791    "background_coloring": "disabled"
 792  }
 793}
 794```
 795
 796**Options**
 797
 7981. Disable indent guides
 799
 800```json
 801{
 802  "indent_guides": {
 803    "enabled": false
 804  }
 805}
 806```
 807
 8082. Enable indent guides for a specific language.
 809
 810```json
 811{
 812  "languages": {
 813    "Python": {
 814      "indent_guides": {
 815        "enabled": true
 816      }
 817    }
 818  }
 819}
 820```
 821
 8223. Enable indent aware coloring ("rainbow indentation").
 823   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.
 824
 825```json
 826{
 827  "indent_guides": {
 828    "enabled": true,
 829    "coloring": "indent_aware"
 830  }
 831}
 832```
 833
 8344. Enable indent aware background coloring ("rainbow indentation").
 835   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.
 836
 837```json
 838{
 839  "indent_guides": {
 840    "enabled": true,
 841    "coloring": "indent_aware",
 842    "background_coloring": "indent_aware"
 843  }
 844}
 845```
 846
 847### Inline Git Blame
 848
 849- Description: Whether or not to show git blame information inline, on the currently focused line (requires Zed `0.132.0`).
 850- Setting: `inline_blame`
 851- Default:
 852
 853```json
 854{
 855  "git": {
 856    "inline_blame": {
 857      "enabled": true
 858    }
 859  }
 860}
 861```
 862
 863**Options**
 864
 8651. Disable inline git blame:
 866
 867```json
 868{
 869  "git": {
 870    "inline_blame": {
 871      "enabled": false
 872    }
 873  }
 874}
 875```
 876
 8772. Only show inline git blame after a delay (that starts after cursor stops moving):
 878
 879```json
 880{
 881  "git": {
 882    "inline_blame": {
 883      "enabled": false,
 884      "delay_ms": 500
 885    }
 886  }
 887}
 888```
 889
 890## Hard Tabs
 891
 892- Description: Whether to indent lines using tab characters or multiple spaces.
 893- Setting: `hard_tabs`
 894- Default: `false`
 895
 896**Options**
 897
 898`boolean` values
 899
 900## Hover Popover Enabled
 901
 902- Description: Whether or not to show the informational hover box when moving the mouse over symbols in the editor.
 903- Setting: `hover_popover_enabled`
 904- Default: `true`
 905
 906**Options**
 907
 908`boolean` values
 909
 910## Inlay hints
 911
 912- Description: Configuration for displaying extra text with hints in the editor.
 913- Setting: `inlay_hints`
 914- Default:
 915
 916```json
 917"inlay_hints": {
 918  "enabled": false,
 919  "show_type_hints": true,
 920  "show_parameter_hints": true,
 921  "show_other_hints": true,
 922  "edit_debounce_ms": 700,
 923  "scroll_debounce_ms": 50
 924}
 925```
 926
 927**Options**
 928
 929Inlay hints querying consists of two parts: editor (client) and LSP server.
 930With 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.
 931At 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.
 932
 933The following languages have inlay hints preconfigured by Zed:
 934
 935- [Go](https://docs.zed.dev/languages/go)
 936- [Rust](https://docs.zed.dev/languages/rust)
 937- [Svelte](https://docs.zed.dev/languages/svelte)
 938- [Typescript](https://docs.zed.dev/languages/typescript)
 939
 940Use the `lsp` section for the server configuration. Examples are provided in the corresponding language documentation.
 941
 942Hints are not instantly queried in Zed, two kinds of debounces are used, either may be set to 0 to be disabled.
 943Settings-related hint updates are not debounced.
 944
 945## Journal
 946
 947- Description: Configuration for the journal.
 948- Setting: `journal`
 949- Default:
 950
 951```json
 952"journal": {
 953  "path": "~",
 954  "hour_format": "hour12"
 955}
 956```
 957
 958### Path
 959
 960- Description: The path of the directory where journal entries are stored.
 961- Setting: `path`
 962- Default: `~`
 963
 964**Options**
 965
 966`string` values
 967
 968### Hour Format
 969
 970- Description: The format to use for displaying hours in the journal.
 971- Setting: `hour_format`
 972- Default: `hour12`
 973
 974**Options**
 975
 9761. 12-hour format:
 977
 978```json
 979{
 980  "hour_format": "hour12"
 981}
 982```
 983
 9842. 24-hour format:
 985
 986```json
 987{
 988  "hour_format": "hour24"
 989}
 990```
 991
 992## Languages
 993
 994- Description: Configuration for specific languages.
 995- Setting: `languages`
 996- Default: `null`
 997
 998**Options**
 999
1000To override settings for a language, add an entry for that languages name to the `languages` value. Example:
1001
1002```json
1003"languages": {
1004  "C": {
1005    "format_on_save": "off",
1006    "preferred_line_length": 64,
1007    "soft_wrap": "preferred_line_length"
1008  },
1009  "JSON": {
1010    "tab_size": 4
1011  }
1012}
1013```
1014
1015The following settings can be overridden for each specific language:
1016
1017- `enable_language_server`
1018- `ensure_final_newline_on_save`
1019- `format_on_save`
1020- `formatter`
1021- `hard_tabs`
1022- `preferred_line_length`
1023- `remove_trailing_whitespace_on_save`
1024- `show_inline_completions`
1025- `show_whitespaces`
1026- `soft_wrap`
1027- `tab_size`
1028- `use_autoclose`
1029- `always_treat_brackets_as_autoclosed`
1030
1031These values take in the same options as the root-level settings with the same name.
1032
1033## Preview tabs
1034
1035- Description:
1036  (requires Zed `0.132.x`) \
1037  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. \
1038   There are several ways to convert a preview tab into a regular tab:
1039
1040  - Double-clicking on the file
1041  - Double-clicking on the tab header
1042  - Using the `project_panel::OpenPermanent` action
1043  - Editing the file
1044  - Dragging the file to a different pane
1045
1046- Setting: `preview_tabs`
1047- Default:
1048
1049```json
1050"preview_tabs": {
1051  "enabled": true,
1052  "enable_preview_from_file_finder": false,
1053  "enable_preview_from_code_navigation": false,
1054}
1055```
1056
1057### Enable preview from file finder
1058
1059- Description: Determines whether to open files in preview mode when selected from the file finder.
1060- Setting: `enable_preview_from_file_finder`
1061- Default: `false`
1062
1063**Options**
1064
1065`boolean` values
1066
1067### Enable preview from code navigation
1068
1069- Description: Determines whether a preview tab gets replaced when code navigation is used to navigate away from the tab (requires Zed `0.134.x`).
1070- Setting: `enable_preview_from_code_navigation`
1071- Default: `false`
1072
1073**Options**
1074
1075`boolean` values
1076
1077## Preferred Line Length
1078
1079- Description: The column at which to soft-wrap lines, for buffers where soft-wrap is enabled.
1080- Setting: `preferred_line_length`
1081- Default: `80`
1082
1083**Options**
1084
1085`integer` values
1086
1087## Projects Online By Default
1088
1089- Description: Whether or not to show the online projects view by default.
1090- Setting: `projects_online_by_default`
1091- Default: `true`
1092
1093**Options**
1094
1095`boolean` values
1096
1097## Remove Trailing Whitespace On Save
1098
1099- Description: Whether or not to remove any trailing whitespace from lines of a buffer before saving it.
1100- Setting: `remove_trailing_whitespace_on_save`
1101- Default: `true`
1102
1103**Options**
1104
1105`boolean` values
1106
1107## Show Call Status Icon
1108
1109- Description: Whether or not to show the call status icon in the status bar.
1110- Setting: `show_call_status_icon`
1111- Default: `true`
1112
1113**Options**
1114
1115`boolean` values
1116
1117## Show Completions On Input
1118
1119- Description: Whether or not to show completions as you type.
1120- Setting: `show_completions_on_input`
1121- Default: `true`
1122
1123**Options**
1124
1125`boolean` values
1126
1127## Show Completion Documentation
1128
1129- Description: Whether to display inline and alongside documentation for items in the completions menu.
1130- Setting: `show_completion_documentation`
1131- Default: `true`
1132
1133**Options**
1134
1135`boolean` values
1136
1137## Completion Documentation Debounce Delay
1138
1139- Description: The debounce delay before re-querying the language server for completion documentation when not included in original completion list.
1140- Setting: `completion_documentation_secondary_query_debounce`
1141- Default: `300` ms
1142
1143**Options**
1144
1145`integer` values
1146
1147## Show Inline Completions
1148
1149- Description: Whether to show inline completions as you type or manually by triggering `editor::ShowInlineCompletion`.
1150- Setting: `show_inline_completions`
1151- Default: `true`
1152
1153**Options**
1154
1155`boolean` values
1156
1157## Show Whitespaces
1158
1159- Description: Whether or not to show render whitespace characters in the editor.
1160- Setting: `show_whitespaces`
1161- Default: `selection`
1162
1163**Options**
1164
11651. `all`
11662. `selection`
11673. `none`
11684. `boundary`
1169
1170## Soft Wrap
1171
1172- Description: Whether or not to automatically wrap lines of text to fit editor / preferred width.
1173- Setting: `soft_wrap`
1174- Default: `prefer_line`
1175
1176**Options**
1177
11781. `none` to stop the soft-wrapping
11792. `prefer_line` to avoid wrapping generally, unless the line is too long
11803. `editor_width` to wrap lines that overflow the editor width
11814. `preferred_line_length` to wrap lines that overflow `preferred_line_length` config value
1182
1183## Wrap Guides (Vertical Rulers)
1184
1185- Description: Where to display vertical rulers as wrap-guides. Disable by setting `show_wrap_guides` to `false`.
1186- Setting: `wrap_guides`
1187- Default: []
1188
1189**Options**
1190
1191List of `integer` column numbers
1192
1193## Tab Size
1194
1195- Description: The number of spaces to use for each tab character.
1196- Setting: `tab_size`
1197- Default: `4`
1198
1199**Options**
1200
1201`integer` values
1202
1203## Telemetry
1204
1205- Description: Control what info is collected by Zed.
1206- Setting: `telemetry`
1207- Default:
1208
1209```json
1210"telemetry": {
1211  "diagnostics": true,
1212  "metrics": true
1213},
1214```
1215
1216**Options**
1217
1218### Diagnostics
1219
1220- Description: Setting for sending debug-related data, such as crash reports.
1221- Setting: `diagnostics`
1222- Default: `true`
1223
1224**Options**
1225
1226`boolean` values
1227
1228### Metrics
1229
1230- Description: Setting for sending anonymized usage data, such what languages you're using Zed with.
1231- Setting: `metrics`
1232- Default: `true`
1233
1234**Options**
1235
1236`boolean` values
1237
1238## Terminal
1239
1240- Description: Configuration for the terminal.
1241- Setting: `terminal`
1242- Default:
1243
1244```json
1245"terminal": {
1246  "alternate_scroll": "off",
1247  "blinking": "terminal_controlled",
1248  "copy_on_select": false,
1249  "env": {},
1250  "font_family": null,
1251  "font_features": null,
1252  "font_size": null,
1253  "option_as_meta": false,
1254  "button": false,
1255  "shell": {},
1256  "toolbar": {
1257    "title": true
1258  },
1259  "working_directory": "current_project_directory"
1260}
1261```
1262
1263### Alternate Scroll
1264
1265- 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.
1266- Setting: `alternate_scroll`
1267- Default: `off`
1268
1269**Options**
1270
12711. Default alternate scroll mode to on
1272
1273```json
1274{
1275  "alternate_scroll": "on"
1276}
1277```
1278
12792. Default alternate scroll mode to off
1280
1281```json
1282{
1283  "alternate_scroll": "off"
1284}
1285```
1286
1287### Blinking
1288
1289- Description: Set the cursor blinking behavior in the terminal
1290- Setting: `blinking`
1291- Default: `terminal_controlled`
1292
1293**Options**
1294
12951. Never blink the cursor, ignore the terminal mode
1296
1297```json
1298{
1299  "blinking": "off"
1300}
1301```
1302
13032. Default the cursor blink to off, but allow the terminal to turn blinking on
1304
1305```json
1306{
1307  "blinking": "terminal_controlled"
1308}
1309```
1310
13113. Always blink the cursor, ignore the terminal mode
1312
1313```json
1314"blinking": "on",
1315```
1316
1317### Copy On Select
1318
1319- Description: Whether or not selecting text in the terminal will automatically copy to the system clipboard.
1320- Setting: `copy_on_select`
1321- Default: `false`
1322
1323**Options**
1324
1325`boolean` values
1326
1327### Env
1328
1329- 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
1330- Setting: `env`
1331- Default: `{}`
1332
1333**Example**
1334
1335```json
1336"env": {
1337  "ZED": "1",
1338  "KEY": "value1:value2"
1339}
1340```
1341
1342### Font Size
1343
1344- Description: What font size to use for the terminal. When not set defaults to matching the editor's font size
1345- Setting: `font_size`
1346- Default: `null`
1347
1348**Options**
1349
1350`integer` values
1351
1352### Font Family
1353
1354- Description: What font to use for the terminal. When not set, defaults to matching the editor's font.
1355- Setting: `font_family`
1356- Default: `null`
1357
1358**Options**
1359
1360The name of any font family installed on the user's system
1361
1362### Font Features
1363
1364- Description: What font features to use for the terminal. When not set, defaults to matching the editor's font features.
1365- Setting: `font_features`
1366- Default: `null`
1367
1368**Options**
1369
1370See Buffer Font Features
1371
1372### Option As Meta
1373
1374- Description: Re-interprets the option keys to act like a 'meta' key, like in Emacs.
1375- Setting: `option_as_meta`
1376- Default: `true`
1377
1378**Options**
1379
1380`boolean` values
1381
1382### Shell
1383
1384- Description: What shell to use when launching the terminal.
1385- Setting: `shell`
1386- Default: `system`
1387
1388**Options**
1389
13901. Use the system's default terminal configuration (usually the `/etc/passwd` file).
1391
1392```json
1393{
1394  "shell": "system"
1395}
1396```
1397
13982. A program to launch:
1399
1400```json
1401"shell": {
1402    "program": "sh"
1403}
1404```
1405
14063. A program with arguments:
1407
1408```json
1409"shell": {
1410  "with_arguments": {
1411    "program": "/bin/bash",
1412    "args": ["--login"]
1413  }
1414}
1415```
1416
1417## Terminal Toolbar
1418
1419- Description: Whether or not to show various elements in the terminal toolbar. It only affects terminals placed in the editor pane.
1420- Setting: `toolbar`
1421- Default:
1422
1423```json
1424"toolbar": {
1425  "title": true,
1426},
1427```
1428
1429**Options**
1430
1431At 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.
1432
1433### Terminal Button
1434
1435- Description: Control to show or hide the terminal button in the status bar
1436- Setting: `button`
1437- Default: `true`
1438
1439**Options**
1440
1441`boolean` values
1442
1443### Working Directory
1444
1445- Description: What working directory to use when launching the terminal.
1446- Setting: `working_directory`
1447- Default: `"current_project_directory"`
1448
1449**Options**
1450
14511. Use the current file's project directory. Will Fallback to the first project directory strategy if unsuccessful
1452
1453```json
1454{
1455  "working_directory": "current_project_directory"
1456}
1457```
1458
14592. Use the first project in this workspace's directory. Will fallback to using this platform's home directory.
1460
1461```json
1462{
1463  "working_directory": "first_project_directory"
1464}
1465```
1466
14673. Always use this platform's home directory (if we can find it)
1468
1469```json
1470{
1471  "working_directory": "always_home"
1472}
1473```
1474
14754. 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.
1476
1477```json
1478"working_directory": {
1479  "always": {
1480    "directory": "~/zed/projects/"
1481  }
1482}
1483```
1484
1485## Theme
1486
1487- 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.
1488- Setting: `theme`
1489- Default: `One Dark`
1490
1491### Theme Object
1492
1493- Description: Specify the theme using an object that includes the `mode`, `dark`, and `light` themes.
1494- Setting: `theme`
1495- Default:
1496
1497```json
1498"theme": {
1499  "mode": "system",
1500  "dark": "One Dark",
1501  "light": "One Light"
1502},
1503```
1504
1505### Mode
1506
1507- Description: Specify theme mode.
1508- Setting: `mode`
1509- Default: `system`
1510
1511**Options**
1512
15131. Set the theme to dark mode
1514
1515```json
1516{
1517  "mode": "dark"
1518}
1519```
1520
15212. Set the theme to light mode
1522
1523```json
1524{
1525  "mode": "light"
1526}
1527```
1528
15293. Set the theme to system mode
1530
1531```json
1532{
1533  "mode": "system"
1534}
1535```
1536
1537### Dark
1538
1539- Description: The name of the dark Zed theme to use for the UI.
1540- Setting: `dark`
1541- Default: `One Dark`
1542
1543**Options**
1544
1545Run the `theme selector: toggle` action in the command palette to see a current list of valid themes names.
1546
1547### Light
1548
1549- Description: The name of the light Zed theme to use for the UI.
1550- Setting: `light`
1551- Default: `One Light`
1552
1553**Options**
1554
1555Run the `theme selector: toggle` action in the command palette to see a current list of valid themes names.
1556
1557## Vim
1558
1559- Description: Whether or not to enable vim mode (work in progress).
1560- Setting: `vim_mode`
1561- Default: `false`
1562
1563## Project Panel
1564
1565- Description: Customise project panel
1566- Setting: `project_panel`
1567- Default:
1568
1569```json
1570"project_panel": {
1571  "button": true,
1572  "dock": "left",
1573  "git_status": true,
1574  "default_width": "N/A - width in pixels",
1575  "auto_reveal_entries": true,
1576  "auto_fold_dirs": false,
1577  "file_icons": true,
1578  "folder_icons": true,
1579  "indent_size" : 20,
1580  "scrollbar": {
1581    "show": "always"
1582  }
1583},
1584```
1585
1586### Dock
1587
1588- Description: Control the position of the dock
1589- Setting: `dock`
1590- Default: `left`
1591
1592**Options**
1593
15941. Default dock position to left
1595
1596```json
1597{
1598  "dock": "left"
1599}
1600```
1601
16022. Default dock position to right
1603
1604```json
1605{
1606  "dock": "right"
1607}
1608```
1609
1610### Git Status
1611
1612- Description: Indicates newly created and updated files
1613- Setting: `git_status`
1614- Default: `true`
1615
1616**Options**
1617
16181. Default enable git status
1619
1620```json
1621{
1622  "git_status": true
1623}
1624```
1625
16262. Default disable git status
1627
1628```json
1629{
1630  "git_status": false
1631}
1632```
1633
1634### Default Width
1635
1636- Description: Customise default width taken by project panel
1637- Setting: `default_width`
1638- Default: N/A width in pixels (eg: 420)
1639
1640**Options**
1641
1642`boolean` values
1643
1644### Auto Reveal Entries
1645
1646- Description: Whether to reveal it in the project panel automatically, when a corresponding project entry becomes active. Gitignored entries are never auto revealed.
1647- Setting: `auto_reveal_entries`
1648- Default: `true`
1649
1650**Options**
1651
16521. Enable auto reveal entries
1653   
1654```json
1655{
1656    "auto_reveal_entries": true,
1657}
1658```
1659
16602. Disable auto reveal entries
1661   
1662```json
1663{
1664    "auto_reveal_entries": false,
1665}
1666```
1667
1668### Auto Fold Dirs
1669
1670- Description: Whether to fold directories automatically when directory has only one directory inside.
1671- Setting: `auto_fold_dirs`
1672- Default: `false`
1673
1674**Options**
1675
16761. Enable auto fold dirs
1677   
1678```json
1679{
1680    "auto_fold_dirs": true,
1681}
1682```
1683
16842. Disable auto fold dirs
1685   
1686```json
1687{
1688    "auto_fold_dirs": false,
1689}
1690```
1691
1692### Indent Size
1693
1694- Description: Amount of indentation (in pixels) for nested items.
1695- Setting: `indent_size`
1696- Default: `20`
1697
1698### Scrollbar
1699
1700- Description: Scrollbar related settings. Possible values: "always", "never".
1701- Setting: `scrollbar`
1702- Default: ```json
1703    "scrollbar": {
1704        "show": "always"
1705    }```
1706
1707**Options**
1708
17091. Show scrollbar in project panel
1710   
1711```json
1712{
1713    "scrollbar": {
1714        "show": "always"
1715    }
1716}
1717```
1718
17192. Hide scrollbar in project panel
1720   
1721```json
1722{
1723    "scrollbar": {
1724        "show": "never"
1725    }
1726}
1727```
1728
1729## Calls
1730
1731- Description: Customise behaviour when participating in a call
1732- Setting: `calls`
1733- Default:
1734
1735```json
1736"calls": {
1737  // Join calls with the microphone live by default
1738  "mute_on_join": false,
1739  // Share your project when you are the first to join a channel
1740  "share_on_join": false
1741},
1742```
1743
1744## An example configuration:
1745
1746```json
1747// ~/.config/zed/settings.json
1748{
1749  "theme": "cave-light",
1750  "tab_size": 2,
1751  "preferred_line_length": 80,
1752  "soft_wrap": "none",
1753
1754  "buffer_font_size": 18,
1755  "buffer_font_family": "Zed Plex Mono",
1756
1757  "autosave": "on_focus_change",
1758  "format_on_save": "off",
1759  "vim_mode": false,
1760  "projects_online_by_default": true,
1761  "terminal": {
1762    "font_family": "FiraCode Nerd Font Mono",
1763    "blinking": "off"
1764  },
1765  "languages": {
1766    "C": {
1767      "format_on_save": "language_server",
1768      "preferred_line_length": 64,
1769      "soft_wrap": "preferred_line_length"
1770    }
1771  }
1772}
1773```