5006 lines · 102.2 KB · Markdown
RawDownload

Configuring Zed

Zed 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.

In addition to the settings described here, you may also want to change your theme, configure your key bindings, set up tasks or install extensions.

Settings Editor

You can browse through many of the supported settings via the Settings Editor, which can be opened with the {#kb zed::OpenSettings} keybinding, or through the zed: open settings action in the command palette. Through it, you can customize your local, user settings as well as project settings.

Note that not all settings that Zed supports are available through the Settings Editor yet. Some more intricate ones, such as language formatters, can only be changed through the JSON settings file {#kb zed::OpenSettingsFile}.

User Settings File

Your settings JSON file can be opened with {#kb zed::OpenSettingsFile}. 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.

Whatever you have added to your user settings file gets merged with any local configuration inside your projects.

Default Settings

In the Settings Editor, the values you see set are the default ones. You can also verify them in JSON by running {#action zed::OpenDefaultSettings} from the command palette.

Extensions that provide language servers may also provide default settings for those language servers.

Project Settings File

Similarly to user files, you can open your project settings file by running {#action zed::OpenProjectSettings} from the command palette. This will create a .zed directory containing.zed/settings.json.

Although 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.

The syntax for configuration files is a super-set of JSON that allows // comments.

Per-release Channel Overrides

Zed reads the same settings.json across all release channels (Stable, Preview or Nightly). However, you can scope overrides to a specific channel by adding top-level stable, preview, nightly or dev objects. They are merged into the base configuration with settings from these keys taking precedence upon launching the specified build. For example:

{
  "theme": "sunset",
  "vim_mode": false,
  "nightly": {
    "theme": "cave-light",
    "vim_mode": true
  },
  "preview": {
    "theme": "zed-dark"
  }
}

With this configuration, Stable keeps all base preferences, Preview switches to zed-dark, and Nightly enables Vim mode with a different theme.

Changing settings in the Settings Editorwill always apply the change across all channels.

Settings

Find below an extensive run-through of many supported settings by Zed.

Active Pane Modifiers

  • Description: Styling settings applied to the active pane.
  • Setting: active_pane_modifiers
  • Default:
{
  "active_pane_modifiers": {
    "border_size": 0.0,
    "inactive_opacity": 1.0
  }
}

Border size

  • Description: Size of the border surrounding the active pane. When set to 0, the active pane doesn't have any border. The border is drawn inset.
  • Setting: border_size
  • Default: 0.0

Options

Non-negative float values

Inactive Opacity

  • Description: Opacity of inactive panels. When set to 1.0, the inactive panes have the same opacity as the active one. If set to 0, the inactive panes content will not be visible at all. Values are clamped to the [0.0, 1.0] range.
  • Setting: inactive_opacity
  • Default: 1.0

Options

float values

Bottom Dock Layout

  • Description: Control the layout of the bottom dock, relative to the left and right docks.
  • Setting: bottom_dock_layout
  • Default: "contained"

Options

  1. Contain the bottom dock, giving the full height of the window to the left and right docks.
{
  "bottom_dock_layout": "contained"
}
  1. Give the bottom dock the full width of the window, truncating the left and right docks.
{
  "bottom_dock_layout": "full"
}
  1. Left align the bottom dock, truncating the left dock and giving the right dock the full height of the window.
{
  "bottom_dock_layout": "left_aligned"
}
  1. Right align the bottom dock, giving the left dock the full height of the window and truncating the right dock.
{
  "bottom_dock_layout": "right_aligned"
}

Agent Font Size

  • Description: The font size for text in the agent panel. Inherits the UI font size if unset.
  • Setting: agent_font_size
  • Default: null

Options

integer values from 6 to 100 pixels (inclusive)

Allow Rewrap

  • Description: Controls where the {#action editor::Rewrap} action is allowed in the current language scope
  • Setting: allow_rewrap
  • Default: "in_comments"

Options

  1. Allow rewrap in comments only:
{
  "allow_rewrap": "in_comments"
}
  1. Allow rewrap in selections only:
{
  "allow_rewrap": "in_selections"
}
  1. Allow rewrap anywhere:
{
  "allow_rewrap": "anywhere"
}

Note: This setting has no effect in Vim mode, as rewrap is already allowed everywhere.

Auto Indent

  • Description: Whether indentation should be adjusted based on the context whilst typing. This can be specified on a per-language basis.
  • Setting: auto_indent
  • Default: true

Options

boolean values

Auto Indent On Paste

  • Description: Whether indentation of pasted content should be adjusted based on the context
  • Setting: auto_indent_on_paste
  • Default: true

Options

boolean values

Auto Install extensions

  • Description: Define extensions to be autoinstalled or never be installed.
  • Setting: auto_install_extensions
  • Default: { "html": true }

Options

You can find the names of your currently installed extensions by listing the subfolders under the extension installation location:

On macOS:

ls ~/Library/Application\ Support/Zed/extensions/installed/

On Linux:

ls ~/.local/share/zed/extensions/installed

Define extensions which should be installed (true) or never installed (false).

{
  "auto_install_extensions": {
    "html": true,
    "dockerfile": true,
    "docker-compose": false
  }
}

Autosave

  • Description: When to automatically save edited buffers.
  • Setting: autosave
  • Default: off

Options

  1. To disable autosave, set it to off:
{
  "autosave": "off"
}
  1. To autosave when focus changes, use on_focus_change:
{
  "autosave": "on_focus_change"
}
  1. To autosave when the active window changes, use on_window_change:
{
  "autosave": "on_window_change"
}
  1. To autosave after an inactivity period, use after_delay:
{
  "autosave": {
    "after_delay": {
      "milliseconds": 1000
    }
  }
}

Note that a save will be triggered when an unsaved tab is closed, even if this is earlier than the configured inactivity period.

Autoscroll on Clicks

  • Description: Whether to scroll when clicking near the edge of the visible text area.
  • Setting: autoscroll_on_clicks
  • Default: false

Options

boolean values

Auto Signature Help

  • Description: Show method signatures in the editor, when inside parentheses
  • Setting: auto_signature_help
  • Default: false

Options

boolean values

Show Signature Help After Edits

  • Description: Whether to show the signature help after completion or a bracket pair inserted. If auto_signature_help is enabled, this setting will be treated as enabled also.
  • Setting: show_signature_help_after_edits
  • Default: false

Options

boolean values

Auto Update

  • Description: Whether or not to automatically check for updates.
  • Setting: auto_update
  • Default: true

Options

boolean values

Base Keymap

  • Description: Base key bindings scheme. Base keymaps can be overridden with user keymaps.
  • Setting: base_keymap
  • Default: VSCode

Options

  1. VS Code
{
  "base_keymap": "VSCode"
}
  1. Atom
{
  "base_keymap": "Atom"
}
  1. JetBrains
{
  "base_keymap": "JetBrains"
}
  1. None
{
  "base_keymap": "None"
}
  1. Sublime Text
{
  "base_keymap": "SublimeText"
}
  1. TextMate
{
  "base_keymap": "TextMate"
}

Buffer Font Family

  • Description: The name of a font to use for rendering text in the editor.
  • Setting: buffer_font_family
  • Default: .ZedMono. This currently aliases to Lilex.

Options

The name of any font family installed on the user's system, or ".ZedMono".

Buffer Font Features

  • Description: The OpenType features to enable for text in the editor.
  • Setting: buffer_font_features
  • Default: null
  • Platform: macOS and Windows.

Options

Zed 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.

For example, to disable font ligatures, add the following to your settings:

{
  "buffer_font_features": {
    "calt": false
  }
}

You can also set other OpenType features, like setting cv01 to 7:

{
  "buffer_font_features": {
    "cv01": 7
  }
}

Buffer Font Fallbacks

  • Description: Set the buffer text's font fallbacks, this will be merged with the platform's default fallbacks.
  • Setting: buffer_font_fallbacks
  • Default: null
  • Platform: macOS and Windows.

Options

For example, to use Nerd Font as a fallback, add the following to your settings:

{
  "buffer_font_fallbacks": ["Nerd Font"]
}

Buffer Font Size

  • Description: The default font size for text in the editor.
  • Setting: buffer_font_size
  • Default: 15

Options

A font size from 6 to 100 pixels (inclusive)

Buffer Font Weight

  • Description: The default font weight for text in the editor.
  • Setting: buffer_font_weight
  • Default: 400

Options

integer values between 100 and 900

Buffer Line Height

  • Description: The default line height for text in the editor.
  • Setting: buffer_line_height
  • Default: "comfortable"

Options

"standard", "comfortable" or { "custom": float } (1 is compact, 2 is loose)

Centered Layout

  • Description: Configuration for the centered layout mode.
  • Setting: centered_layout
  • Default:
"centered_layout": {
  "left_padding": 0.2,
  "right_padding": 0.2,
}

Options

The left_padding and right_padding options define the relative width of the left 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.

Close on File Delete

  • Description: Whether to automatically close editor tabs when their corresponding files are deleted from disk.
  • Setting: close_on_file_delete
  • Default: false

Lines 1–500 of 5006.