2900 lines · 54.6 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 files

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

This configuration is merged with any local configuration inside your projects. You can open the project settings 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.

Default settings

You can find the default settings for your current Zed by running {#action zed::OpenDefaultSettings} from the command palette.

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

Settings

Active Pane Modifiers

Styling settings applied to the active pane.

Magnification

  • 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.
  • Setting: magnification
  • Default: 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

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

Auto Install extensions

  • Description: Define extensions to be autoinstalled or never be installed.
  • Setting: auto_install_extension
  • 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
    }
  }
}

Restore on Startup

  • Description: Controls session restoration on startup.
  • Setting: restore_on_startup
  • Default: last_session

Options

  1. Restore all workspaces that were open when quitting Zed:
{
  "restore_on_startup": "last_session"
}
  1. Restore the workspace that was closed last:
{
  "restore_on_startup": "last_workspace"
}
  1. Always start with an empty editor:
{
  "restore_on_startup": "none"
}

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 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. VSCode
{
  "base_keymap": "VSCode"
}
  1. Atom
{
  "base_keymap": "Atom"
}
  1. JetBrains
{
  "base_keymap": "JetBrains"
}
  1. None
{
  "base_keymap": "None"
}
  1. SublimeText
{
  "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: Zed Plex Mono

Options

The name of any font family installed on the user's system

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

integer values 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 very compact, 2 very loose)

Confirm Quit

  • Description: Whether or not to prompt the user to confirm before closing the application.
  • Setting: confirm_quit
  • Default: false

Options

boolean values

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.

Direnv Integration

  • Description: Settings for direnv integration. Requires direnv to be installed. direnv integration make it possible to use the environment variables set by a direnv configuration to detect some language servers in $PATH instead of installing them. It also allows for those environment variables to be used in tasks.
  • Setting: load_direnv
  • Default:
"load_direnv": "direct"

Options There are two options to choose from:

  1. shell_hook: Use the shell hook to load direnv. This relies on direnv to activate upon entering the directory. Supports POSIX shells and fish.
  2. 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.

Edit Predictions

  • Description: Settings for edit predictions.
  • Setting: edit_predictions
  • Default:
  "edit_predictions": {
    "disabled_globs": [
      "**/.env*",
      "**/*.pem",
      "**/*.key",
      "**/*.cert",
      "**/*.crt",
      "**/secrets.yml"
    ]
  }

Options

Disabled Globs

  • Description: A list of globs for which edit predictions should be disabled for. This list adds to a pre-existing, sensible default set of globs. Any additional ones you add are combined with them.
  • Setting: disabled_globs
  • Default: ["**/.env*", "**/*.pem", "**/*.key", "**/*.cert", "**/*.crt", "**/secrets.yml"]

Options

List of string values.

Edit Predictions Disabled in

  • Description: A list of language scopes in which edit predictions should be disabled.
  • Setting: edit_predictions_disabled_in
  • Default: []

Options

List of string values

  1. Don't show edit predictions in comments:
"disabled_in": ["comment"]
  1. Don't show edit predictions in strings and comments:
"disabled_in": ["comment", "string"]
  1. Only in Go, don't show edit predictions in strings and comments:
{
  "languages": {
    "Go": {
      "edit_predictions_disabled_in": ["comment", "string"]
    }
  }
}

Current Line Highlight

  • Description: How to highlight the current line in the editor.
  • Setting: current_line_highlight
  • Default: all

Options

  1. Don't highlight the current line:
"current_line_highlight": "none"
  1. Highlight the gutter area:
"current_line_highlight": "gutter"
  1. Highlight the editor area:
"current_line_highlight": "line"
  1. Highlight the full line:
"current_line_highlight": "all"

Selection Highlight

  • Description: Whether to highlight all occurrences of the selected text in an editor.
  • Setting: selection_highlight
  • Default: true

Selection Highlight Debounce

  • Description: The debounce delay before querying highlights based on the selected text.

  • Setting: selection_highlight_debounce

  • Default: 50

LSP Highlight Debounce

  • Description: The debounce delay before querying highlights from the language server based on the current cursor location.
  • Setting: lsp_highlight_debounce
  • Default: 75
  • Description: Whether or not the cursor blinks.
  • Setting: cursor_blink
  • Default: true

Options

Lines 1–500 of 2900.