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 behavior 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
 606```json
 607{
 608  "formatter": [
 609    {"language_server": {"name": "rust-analyzer"}},
 610    {"external": {
 611      "command": "sed",
 612      "arguments": ["-e", "s/ *$//"]
 613    }
 614  ]
 615}
 616```
 617
 618Here `rust-analyzer` will be used first to format the code, followed by a call of sed.
 619If any of the formatters fails, the subsequent ones will still be executed.
 620
 621## Code Actions On Format
 622
 623- Description: The code actions to perform with the primary language server when formatting the buffer.
 624- Setting: `code_actions_on_format`
 625- Default: `{}`, except for Go it's `{ "source.organizeImports": true }`
 626
 627**Examples**
 628
 6291. Organize imports on format in TypeScript and TSX buffers:
 630
 631```json
 632{
 633  "languages": {
 634    "TypeScript": {
 635      "code_actions_on_format": {
 636        "source.organizeImports": true
 637      }
 638    },
 639    "TSX": {
 640      "code_actions_on_format": {
 641        "source.organizeImports": true
 642      }
 643    }
 644  }
 645}
 646```
 647
 6482. Run ESLint `fixAll` code action when formatting (requires Zed `0.125.0`):
 649
 650```json
 651{
 652  "languages": {
 653    "JavaScript": {
 654      "code_actions_on_format": {
 655        "source.fixAll.eslint": true
 656      }
 657    }
 658  }
 659}
 660```
 661
 6623. Run only a single ESLint rule when using `fixAll` (requires Zed `0.125.0`):
 663
 664```json
 665{
 666  "languages": {
 667    "JavaScript": {
 668      "code_actions_on_format": {
 669        "source.fixAll.eslint": true
 670      }
 671    }
 672  },
 673  "lsp": {
 674    "eslint": {
 675      "settings": {
 676        "codeActionOnSave": {
 677          "rules": ["import/order"]
 678        }
 679      }
 680    }
 681  }
 682}
 683```
 684
 685## Auto close
 686
 687- Description: Whether to automatically add matching closing characters when typing opening parenthesis, bracket, brace, single or double quote characters.
 688- Setting: `use_autoclose`
 689- Default: `true`
 690
 691**Options**
 692
 693`boolean` values
 694
 695## Always Treat Brackets As Autoclosed
 696
 697- Description: Controls how the editor handles the autoclosed characters.
 698- Setting: `always_treat_brackets_as_autoclosed`
 699- Default: `false`
 700
 701**Options**
 702
 703`boolean` values
 704
 705**Example**
 706
 707If the setting is set to `true`:
 708
 7091. Enter in the editor: `)))`
 7102. Move the cursor to the start: `^)))`
 7113. Enter again: `)))`
 712
 713The result is still `)))` and not `))))))`, which is what it would be by default.
 714
 715## File Types
 716
 717- Setting: `file_types`
 718- Description: Configure how Zed selects a language for a file based on its filename or extension. Supports glob entries.
 719- Default: `{}`
 720
 721**Examples**
 722
 723To interpret all `.c` files as C++, files called `MyLockFile` as TOML and files starting with `Dockerfile` as Dockerfile:
 724
 725```json
 726{
 727  "file_types": {
 728    "C++": ["c"],
 729    "TOML": ["MyLockFile"],
 730    "Dockerfile": ["Dockerfile*"]
 731  }
 732}
 733```
 734
 735## Git
 736
 737- Description: Configuration for git-related features.
 738- Setting: `git`
 739- Default:
 740
 741```json
 742{
 743  "git": {
 744    "git_gutter": "tracked_files",
 745    "inline_blame": {
 746      "enabled": true
 747    }
 748  }
 749}
 750```
 751
 752### Git Gutter
 753
 754- Description: Whether or not to show the git gutter.
 755- Setting: `git_gutter`
 756- Default: `tracked_files`
 757
 758**Options**
 759
 7601. Show git gutter in tracked files
 761
 762```json
 763{
 764  "git": {
 765    "git_gutter": "tracked_files"
 766  }
 767}
 768```
 769
 7702. Hide git gutter
 771
 772```json
 773{
 774  "git": {
 775    "git_gutter": "hide"
 776  }
 777}
 778```
 779
 780### Indent Guides
 781
 782- Description: Configuration related to indent guides (requires Zed `0.138.0`). Indent guides can be configured separately for each language.
 783- Setting: `indent_guides`
 784- Default:
 785
 786```json
 787{
 788  "indent_guides": {
 789    "enabled": true,
 790    "line_width": 1,
 791    "active_line_width": 1,
 792    "coloring": "fixed",
 793    "background_coloring": "disabled"
 794  }
 795}
 796```
 797
 798**Options**
 799
 8001. Disable indent guides
 801
 802```json
 803{
 804  "indent_guides": {
 805    "enabled": false
 806  }
 807}
 808```
 809
 8102. Enable indent guides for a specific language.
 811
 812```json
 813{
 814  "languages": {
 815    "Python": {
 816      "indent_guides": {
 817        "enabled": true
 818      }
 819    }
 820  }
 821}
 822```
 823
 8243. Enable indent aware coloring ("rainbow indentation").
 825   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.
 826
 827```json
 828{
 829  "indent_guides": {
 830    "enabled": true,
 831    "coloring": "indent_aware"
 832  }
 833}
 834```
 835
 8364. Enable indent aware background coloring ("rainbow indentation").
 837   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.
 838
 839```json
 840{
 841  "indent_guides": {
 842    "enabled": true,
 843    "coloring": "indent_aware",
 844    "background_coloring": "indent_aware"
 845  }
 846}
 847```
 848
 849### Inline Git Blame
 850
 851- Description: Whether or not to show git blame information inline, on the currently focused line (requires Zed `0.132.0`).
 852- Setting: `inline_blame`
 853- Default:
 854
 855```json
 856{
 857  "git": {
 858    "inline_blame": {
 859      "enabled": true
 860    }
 861  }
 862}
 863```
 864
 865**Options**
 866
 8671. Disable inline git blame:
 868
 869```json
 870{
 871  "git": {
 872    "inline_blame": {
 873      "enabled": false
 874    }
 875  }
 876}
 877```
 878
 8792. Only show inline git blame after a delay (that starts after cursor stops moving):
 880
 881```json
 882{
 883  "git": {
 884    "inline_blame": {
 885      "enabled": false,
 886      "delay_ms": 500
 887    }
 888  }
 889}
 890```
 891
 892## Hard Tabs
 893
 894- Description: Whether to indent lines using tab characters or multiple spaces.
 895- Setting: `hard_tabs`
 896- Default: `false`
 897
 898**Options**
 899
 900`boolean` values
 901
 902## Hover Popover Enabled
 903
 904- Description: Whether or not to show the informational hover box when moving the mouse over symbols in the editor.
 905- Setting: `hover_popover_enabled`
 906- Default: `true`
 907
 908**Options**
 909
 910`boolean` values
 911
 912## Inlay hints
 913
 914- Description: Configuration for displaying extra text with hints in the editor.
 915- Setting: `inlay_hints`
 916- Default:
 917
 918```json
 919"inlay_hints": {
 920  "enabled": false,
 921  "show_type_hints": true,
 922  "show_parameter_hints": true,
 923  "show_other_hints": true,
 924  "edit_debounce_ms": 700,
 925  "scroll_debounce_ms": 50
 926}
 927```
 928
 929**Options**
 930
 931Inlay hints querying consists of two parts: editor (client) and LSP server.
 932With 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.
 933At 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.
 934
 935The following languages have inlay hints preconfigured by Zed:
 936
 937- [Go](https://docs.zed.dev/languages/go)
 938- [Rust](https://docs.zed.dev/languages/rust)
 939- [Svelte](https://docs.zed.dev/languages/svelte)
 940- [Typescript](https://docs.zed.dev/languages/typescript)
 941
 942Use the `lsp` section for the server configuration. Examples are provided in the corresponding language documentation.
 943
 944Hints are not instantly queried in Zed, two kinds of debounces are used, either may be set to 0 to be disabled.
 945Settings-related hint updates are not debounced.
 946
 947## Journal
 948
 949- Description: Configuration for the journal.
 950- Setting: `journal`
 951- Default:
 952
 953```json
 954"journal": {
 955  "path": "~",
 956  "hour_format": "hour12"
 957}
 958```
 959
 960### Path
 961
 962- Description: The path of the directory where journal entries are stored.
 963- Setting: `path`
 964- Default: `~`
 965
 966**Options**
 967
 968`string` values
 969
 970### Hour Format
 971
 972- Description: The format to use for displaying hours in the journal.
 973- Setting: `hour_format`
 974- Default: `hour12`
 975
 976**Options**
 977
 9781. 12-hour format:
 979
 980```json
 981{
 982  "hour_format": "hour12"
 983}
 984```
 985
 9862. 24-hour format:
 987
 988```json
 989{
 990  "hour_format": "hour24"
 991}
 992```
 993
 994## Languages
 995
 996- Description: Configuration for specific languages.
 997- Setting: `languages`
 998- Default: `null`
 999
1000**Options**
1001
1002To override settings for a language, add an entry for that languages name to the `languages` value. Example:
1003
1004```json
1005"languages": {
1006  "C": {
1007    "format_on_save": "off",
1008    "preferred_line_length": 64,
1009    "soft_wrap": "preferred_line_length"
1010  },
1011  "JSON": {
1012    "tab_size": 4
1013  }
1014}
1015```
1016
1017The following settings can be overridden for each specific language:
1018
1019- `enable_language_server`
1020- `ensure_final_newline_on_save`
1021- `format_on_save`
1022- `formatter`
1023- `hard_tabs`
1024- `preferred_line_length`
1025- `remove_trailing_whitespace_on_save`
1026- `show_inline_completions`
1027- `show_whitespaces`
1028- `soft_wrap`
1029- `tab_size`
1030- `use_autoclose`
1031- `always_treat_brackets_as_autoclosed`
1032
1033These values take in the same options as the root-level settings with the same name.
1034
1035## Preview tabs
1036
1037- Description:
1038  (requires Zed `0.132.x`) \
1039  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. \
1040   There are several ways to convert a preview tab into a regular tab:
1041
1042  - Double-clicking on the file
1043  - Double-clicking on the tab header
1044  - Using the `project_panel::OpenPermanent` action
1045  - Editing the file
1046  - Dragging the file to a different pane
1047
1048- Setting: `preview_tabs`
1049- Default:
1050
1051```json
1052"preview_tabs": {
1053  "enabled": true,
1054  "enable_preview_from_file_finder": false,
1055  "enable_preview_from_code_navigation": false,
1056}
1057```
1058
1059### Enable preview from file finder
1060
1061- Description: Determines whether to open files in preview mode when selected from the file finder.
1062- Setting: `enable_preview_from_file_finder`
1063- Default: `false`
1064
1065**Options**
1066
1067`boolean` values
1068
1069### Enable preview from code navigation
1070
1071- Description: Determines whether a preview tab gets replaced when code navigation is used to navigate away from the tab (requires Zed `0.134.x`).
1072- Setting: `enable_preview_from_code_navigation`
1073- Default: `false`
1074
1075**Options**
1076
1077`boolean` values
1078
1079## Preferred Line Length
1080
1081- Description: The column at which to soft-wrap lines, for buffers where soft-wrap is enabled.
1082- Setting: `preferred_line_length`
1083- Default: `80`
1084
1085**Options**
1086
1087`integer` values
1088
1089## Projects Online By Default
1090
1091- Description: Whether or not to show the online projects view by default.
1092- Setting: `projects_online_by_default`
1093- Default: `true`
1094
1095**Options**
1096
1097`boolean` values
1098
1099## Remove Trailing Whitespace On Save
1100
1101- Description: Whether or not to remove any trailing whitespace from lines of a buffer before saving it.
1102- Setting: `remove_trailing_whitespace_on_save`
1103- Default: `true`
1104
1105**Options**
1106
1107`boolean` values
1108
1109## Show Call Status Icon
1110
1111- Description: Whether or not to show the call status icon in the status bar.
1112- Setting: `show_call_status_icon`
1113- Default: `true`
1114
1115**Options**
1116
1117`boolean` values
1118
1119## Show Completions On Input
1120
1121- Description: Whether or not to show completions as you type.
1122- Setting: `show_completions_on_input`
1123- Default: `true`
1124
1125**Options**
1126
1127`boolean` values
1128
1129## Show Completion Documentation
1130
1131- Description: Whether to display inline and alongside documentation for items in the completions menu.
1132- Setting: `show_completion_documentation`
1133- Default: `true`
1134
1135**Options**
1136
1137`boolean` values
1138
1139## Completion Documentation Debounce Delay
1140
1141- Description: The debounce delay before re-querying the language server for completion documentation when not included in original completion list.
1142- Setting: `completion_documentation_secondary_query_debounce`
1143- Default: `300` ms
1144
1145**Options**
1146
1147`integer` values
1148
1149## Show Inline Completions
1150
1151- Description: Whether to show inline completions as you type or manually by triggering `editor::ShowInlineCompletion`.
1152- Setting: `show_inline_completions`
1153- Default: `true`
1154
1155**Options**
1156
1157`boolean` values
1158
1159## Show Whitespaces
1160
1161- Description: Whether or not to show render whitespace characters in the editor.
1162- Setting: `show_whitespaces`
1163- Default: `selection`
1164
1165**Options**
1166
11671. `all`
11682. `selection`
11693. `none`
11704. `boundary`
1171
1172## Soft Wrap
1173
1174- Description: Whether or not to automatically wrap lines of text to fit editor / preferred width.
1175- Setting: `soft_wrap`
1176- Default: `prefer_line`
1177
1178**Options**
1179
11801. `none` to stop the soft-wrapping
11812. `prefer_line` to avoid wrapping generally, unless the line is too long
11823. `editor_width` to wrap lines that overflow the editor width
11834. `preferred_line_length` to wrap lines that overflow `preferred_line_length` config value
1184
1185## Wrap Guides (Vertical Rulers)
1186
1187- Description: Where to display vertical rulers as wrap-guides. Disable by setting `show_wrap_guides` to `false`.
1188- Setting: `wrap_guides`
1189- Default: []
1190
1191**Options**
1192
1193List of `integer` column numbers
1194
1195## Tab Size
1196
1197- Description: The number of spaces to use for each tab character.
1198- Setting: `tab_size`
1199- Default: `4`
1200
1201**Options**
1202
1203`integer` values
1204
1205## Telemetry
1206
1207- Description: Control what info is collected by Zed.
1208- Setting: `telemetry`
1209- Default:
1210
1211```json
1212"telemetry": {
1213  "diagnostics": true,
1214  "metrics": true
1215},
1216```
1217
1218**Options**
1219
1220### Diagnostics
1221
1222- Description: Setting for sending debug-related data, such as crash reports.
1223- Setting: `diagnostics`
1224- Default: `true`
1225
1226**Options**
1227
1228`boolean` values
1229
1230### Metrics
1231
1232- Description: Setting for sending anonymized usage data, such what languages you're using Zed with.
1233- Setting: `metrics`
1234- Default: `true`
1235
1236**Options**
1237
1238`boolean` values
1239
1240## Terminal
1241
1242- Description: Configuration for the terminal.
1243- Setting: `terminal`
1244- Default:
1245
1246```json
1247"terminal": {
1248  "alternate_scroll": "off",
1249  "blinking": "terminal_controlled",
1250  "copy_on_select": false,
1251  "env": {},
1252  "font_family": null,
1253  "font_features": null,
1254  "font_size": null,
1255  "option_as_meta": false,
1256  "button": false,
1257  "shell": {},
1258  "toolbar": {
1259    "title": true
1260  },
1261  "working_directory": "current_project_directory"
1262}
1263```
1264
1265### Alternate Scroll
1266
1267- 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.
1268- Setting: `alternate_scroll`
1269- Default: `off`
1270
1271**Options**
1272
12731. Default alternate scroll mode to on
1274
1275```json
1276{
1277  "alternate_scroll": "on"
1278}
1279```
1280
12812. Default alternate scroll mode to off
1282
1283```json
1284{
1285  "alternate_scroll": "off"
1286}
1287```
1288
1289### Blinking
1290
1291- Description: Set the cursor blinking behavior in the terminal
1292- Setting: `blinking`
1293- Default: `terminal_controlled`
1294
1295**Options**
1296
12971. Never blink the cursor, ignore the terminal mode
1298
1299```json
1300{
1301  "blinking": "off"
1302}
1303```
1304
13052. Default the cursor blink to off, but allow the terminal to turn blinking on
1306
1307```json
1308{
1309  "blinking": "terminal_controlled"
1310}
1311```
1312
13133. Always blink the cursor, ignore the terminal mode
1314
1315```json
1316"blinking": "on",
1317```
1318
1319### Copy On Select
1320
1321- Description: Whether or not selecting text in the terminal will automatically copy to the system clipboard.
1322- Setting: `copy_on_select`
1323- Default: `false`
1324
1325**Options**
1326
1327`boolean` values
1328
1329### Env
1330
1331- 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
1332- Setting: `env`
1333- Default: `{}`
1334
1335**Example**
1336
1337```json
1338"env": {
1339  "ZED": "1",
1340  "KEY": "value1:value2"
1341}
1342```
1343
1344### Font Size
1345
1346- Description: What font size to use for the terminal. When not set defaults to matching the editor's font size
1347- Setting: `font_size`
1348- Default: `null`
1349
1350**Options**
1351
1352`integer` values
1353
1354### Font Family
1355
1356- Description: What font to use for the terminal. When not set, defaults to matching the editor's font.
1357- Setting: `font_family`
1358- Default: `null`
1359
1360**Options**
1361
1362The name of any font family installed on the user's system
1363
1364### Font Features
1365
1366- Description: What font features to use for the terminal. When not set, defaults to matching the editor's font features.
1367- Setting: `font_features`
1368- Default: `null`
1369
1370**Options**
1371
1372See Buffer Font Features
1373
1374### Option As Meta
1375
1376- Description: Re-interprets the option keys to act like a 'meta' key, like in Emacs.
1377- Setting: `option_as_meta`
1378- Default: `true`
1379
1380**Options**
1381
1382`boolean` values
1383
1384### Shell
1385
1386- Description: What shell to use when launching the terminal.
1387- Setting: `shell`
1388- Default: `system`
1389
1390**Options**
1391
13921. Use the system's default terminal configuration (usually the `/etc/passwd` file).
1393
1394```json
1395{
1396  "shell": "system"
1397}
1398```
1399
14002. A program to launch:
1401
1402```json
1403"shell": {
1404    "program": "sh"
1405}
1406```
1407
14083. A program with arguments:
1409
1410```json
1411"shell": {
1412  "with_arguments": {
1413    "program": "/bin/bash",
1414    "args": ["--login"]
1415  }
1416}
1417```
1418
1419## Terminal Toolbar
1420
1421- Description: Whether or not to show various elements in the terminal toolbar. It only affects terminals placed in the editor pane.
1422- Setting: `toolbar`
1423- Default:
1424
1425```json
1426"toolbar": {
1427  "title": true,
1428},
1429```
1430
1431**Options**
1432
1433At 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.
1434
1435### Terminal Button
1436
1437- Description: Control to show or hide the terminal button in the status bar
1438- Setting: `button`
1439- Default: `true`
1440
1441**Options**
1442
1443`boolean` values
1444
1445### Working Directory
1446
1447- Description: What working directory to use when launching the terminal.
1448- Setting: `working_directory`
1449- Default: `"current_project_directory"`
1450
1451**Options**
1452
14531. Use the current file's project directory. Will Fallback to the first project directory strategy if unsuccessful
1454
1455```json
1456{
1457  "working_directory": "current_project_directory"
1458}
1459```
1460
14612. Use the first project in this workspace's directory. Will fallback to using this platform's home directory.
1462
1463```json
1464{
1465  "working_directory": "first_project_directory"
1466}
1467```
1468
14693. Always use this platform's home directory (if we can find it)
1470
1471```json
1472{
1473  "working_directory": "always_home"
1474}
1475```
1476
14774. 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.
1478
1479```json
1480"working_directory": {
1481  "always": {
1482    "directory": "~/zed/projects/"
1483  }
1484}
1485```
1486
1487## Theme
1488
1489- 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.
1490- Setting: `theme`
1491- Default: `One Dark`
1492
1493### Theme Object
1494
1495- Description: Specify the theme using an object that includes the `mode`, `dark`, and `light` themes.
1496- Setting: `theme`
1497- Default:
1498
1499```json
1500"theme": {
1501  "mode": "system",
1502  "dark": "One Dark",
1503  "light": "One Light"
1504},
1505```
1506
1507### Mode
1508
1509- Description: Specify theme mode.
1510- Setting: `mode`
1511- Default: `system`
1512
1513**Options**
1514
15151. Set the theme to dark mode
1516
1517```json
1518{
1519  "mode": "dark"
1520}
1521```
1522
15232. Set the theme to light mode
1524
1525```json
1526{
1527  "mode": "light"
1528}
1529```
1530
15313. Set the theme to system mode
1532
1533```json
1534{
1535  "mode": "system"
1536}
1537```
1538
1539### Dark
1540
1541- Description: The name of the dark Zed theme to use for the UI.
1542- Setting: `dark`
1543- Default: `One Dark`
1544
1545**Options**
1546
1547Run the `theme selector: toggle` action in the command palette to see a current list of valid themes names.
1548
1549### Light
1550
1551- Description: The name of the light Zed theme to use for the UI.
1552- Setting: `light`
1553- Default: `One Light`
1554
1555**Options**
1556
1557Run the `theme selector: toggle` action in the command palette to see a current list of valid themes names.
1558
1559## Vim
1560
1561- Description: Whether or not to enable vim mode (work in progress).
1562- Setting: `vim_mode`
1563- Default: `false`
1564
1565## Project Panel
1566
1567- Description: Customize project panel
1568- Setting: `project_panel`
1569- Default:
1570
1571```json
1572{
1573  "project_panel": {
1574    "button": true,
1575    "default_width": 240,
1576    "dock": "left",
1577    "file_icons": true,
1578    "folder_icons": true,
1579    "git_status": true,
1580    "indent_size": 20,
1581    "auto_reveal_entries": true,
1582    "auto_fold_dirs": true,
1583    "scrollbar": {
1584      "show": "always"
1585    }
1586  }
1587}
1588```
1589
1590### Dock
1591
1592- Description: Control the position of the dock
1593- Setting: `dock`
1594- Default: `left`
1595
1596**Options**
1597
15981. Default dock position to left
1599
1600```json
1601{
1602  "dock": "left"
1603}
1604```
1605
16062. Default dock position to right
1607
1608```json
1609{
1610  "dock": "right"
1611}
1612```
1613
1614### Git Status
1615
1616- Description: Indicates newly created and updated files
1617- Setting: `git_status`
1618- Default: `true`
1619
1620**Options**
1621
16221. Default enable git status
1623
1624```json
1625{
1626  "git_status": true
1627}
1628```
1629
16302. Default disable git status
1631
1632```json
1633{
1634  "git_status": false
1635}
1636```
1637
1638### Default Width
1639
1640- Description: Customize default width taken by project panel
1641- Setting: `default_width`
1642- Default: N/A width in pixels (eg: 420)
1643
1644**Options**
1645
1646`boolean` values
1647
1648### Auto Reveal Entries
1649
1650- Description: Whether to reveal it in the project panel automatically, when a corresponding project entry becomes active. Gitignored entries are never auto revealed.
1651- Setting: `auto_reveal_entries`
1652- Default: `true`
1653
1654**Options**
1655
16561. Enable auto reveal entries
1657
1658```json
1659{
1660  "auto_reveal_entries": true
1661}
1662```
1663
16642. Disable auto reveal entries
1665
1666```json
1667{
1668  "auto_reveal_entries": false
1669}
1670```
1671
1672### Auto Fold Dirs
1673
1674- Description: Whether to fold directories automatically when directory has only one directory inside.
1675- Setting: `auto_fold_dirs`
1676- Default: `false`
1677
1678**Options**
1679
16801. Enable auto fold dirs
1681
1682```json
1683{
1684  "auto_fold_dirs": true
1685}
1686```
1687
16882. Disable auto fold dirs
1689
1690```json
1691{
1692  "auto_fold_dirs": false
1693}
1694```
1695
1696### Indent Size
1697
1698- Description: Amount of indentation (in pixels) for nested items.
1699- Setting: `indent_size`
1700- Default: `20`
1701
1702### Scrollbar
1703
1704- Description: Scrollbar related settings. Possible values: "always", "never".
1705- Setting: `scrollbar`
1706- Default:
1707
1708```json
1709"scrollbar": {
1710    "show": "always"
1711}
1712```
1713
1714**Options**
1715
17161. Show scrollbar in project panel
1717
1718```json
1719{
1720  "scrollbar": {
1721    "show": "always"
1722  }
1723}
1724```
1725
17262. Hide scrollbar in project panel
1727
1728```json
1729{
1730  "scrollbar": {
1731    "show": "never"
1732  }
1733}
1734```
1735
1736## Assistant Panel
1737
1738- Description: Customize assistant panel
1739- Setting: `assistant`
1740- Default:
1741
1742```json
1743"assistant": {
1744  "enabled": true,
1745  "button": true,
1746  "dock": "right",
1747  "default_width": 640,
1748  "default_height": 320,
1749  "provider": "openai",
1750  "version": "1",
1751},
1752```
1753
1754## Outline Panel
1755
1756- Description: Customize outline Panel
1757- Setting: `outline_panel`
1758- Default:
1759
1760```json
1761"outline_panel": {
1762  "button": true,
1763  "default_width": 240,
1764  "dock": "left",
1765  "file_icons": true,
1766  "folder_icons": true,
1767  "git_status": true,
1768  "indent_size": 20,
1769  "auto_reveal_entries": true,
1770  "auto_fold_dirs": true,
1771}
1772```
1773
1774## Calls
1775
1776- Description: Customize behavior when participating in a call
1777- Setting: `calls`
1778- Default:
1779
1780```json
1781"calls": {
1782  // Join calls with the microphone live by default
1783  "mute_on_join": false,
1784  // Share your project when you are the first to join a channel
1785  "share_on_join": false
1786},
1787```
1788
1789## An example configuration:
1790
1791```json
1792// ~/.config/zed/settings.json
1793{
1794  "theme": "cave-light",
1795  "tab_size": 2,
1796  "preferred_line_length": 80,
1797  "soft_wrap": "none",
1798
1799  "buffer_font_size": 18,
1800  "buffer_font_family": "Zed Plex Mono",
1801
1802  "autosave": "on_focus_change",
1803  "format_on_save": "off",
1804  "vim_mode": false,
1805  "projects_online_by_default": true,
1806  "terminal": {
1807    "font_family": "FiraCode Nerd Font Mono",
1808    "blinking": "off"
1809  },
1810  "languages": {
1811    "C": {
1812      "format_on_save": "language_server",
1813      "preferred_line_length": 64,
1814      "soft_wrap": "preferred_line_length"
1815    }
1816  }
1817}
1818```