Skip to content

Zed windows平台基础配置(vim模式)

约 481 字大约 2 分钟

Zed

2025-06-21

截至本文官方未发行 window 版本可自行编译或下载他人编译后的文件

此处贴一个 star 较多的库:https://github.com/deevus/zed-windows-builds

使用时最好登录账号(有些插件默认使用登录账号进行绑定),目前只支持 github 登录

目前有些操作无法进行自定义,用户可自定义文件分为**SettingsKeymap**

Settings -----本文件是对编辑器进行自定义

// Zed settings
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
//
// To see all of Zed's default settings without changing your
// custom settings, run `zed: open default settings` from the
// command palette (cmd-shift-p / ctrl-shift-p)
{
  "edit_predictions": {
    "mode": "subtle",
    "copilot": {
      "proxy": null,
      "proxy_no_verify": null,
      "enterprise_uri": null
    },
    "enabled_in_text_threads": false
  },
  "features": {
    "edit_prediction_provider": "zed"
  },
  "git_panel": {
    "dock": "left"
  },
  "icon_theme": "Material Icon Theme",
  "vim_mode": true,
  "base_keymap": "VSCode",
  "ui_font_size": 18,
  "buffer_font_size": 19,
  "buffer_font_family": "JetBrainsMono Nerd Font Mono",
  "theme": {
    "mode": "system",
    "light": "Everforest Dark",
    "dark": "One Dark"
  },
  "inlay_hints": {
    "enabled": true,
    "show_type_hints": true,
    "show_parameter_hints": true,
    "show_other_hints": true,
    "show_background": false,
    "edit_debounce_ms": 700,
    "scroll_debounce_ms": 50,
    "toggle_on_modifiers_press": null
  },
  "terminal": {
    "font_family": "JetBrainsMono Nerd Font Mono"
  },
  "minimap": {
    "show": "auto",
    "thumb": "always",
    "thumb_border": "left_open",
    "current_line_highlight": null
  },
  "languages": {
    "slint": {
      "language_servers": ["slint-lsp"]
    }
  }
}

Keymap -----本文件是对快捷键进行自定义

// Zed keymap
//
// For information on binding keys, see the Zed
// documentation: https://zed.dev/docs/key-bindings
//
// To see the default key bindings run `zed: open default keymap`
// from the command palette.
[
  {
    "context": "Workspace",
    "bindings": {
      "ctrl-shift-e": "file_finder::Toggle",
      "ctrl-e": "project_panel::ToggleFocus"
    }
  },
  {
    "context": "!ContextEditor > Editor && mode == full",
    "bindings": {
      "ctrl-e": "project_panel::ToggleFocus"
    }
  },
  {
    "context": "Editor && vim_mode == insert && !menu",
    "bindings": {
      "j k": "vim::SwitchToNormalMode"
    }
  },
  {
    "context": "Editor && vim_mode == normal",
    "bindings": {
      "space w": "pane::CloseActiveItem",
      "space k": "editor::Hover",
      "space c a": "editor::ToggleCodeActions" // quick fix
    }
  },
  {
    "context": "Editor && !menu",
    "bindings": {
      "ctrl-c": "editor::Copy", // vim default: return to normal mode
      "ctrl-x": "editor::Cut", // vim default: decrement
      "ctrl-v": "editor::Paste", // vim default: visual block mode
      "ctrl-y": "editor::Undo", // vim default: line up
      "ctrl-f": "buffer_search::Deploy", // vim default: page down
      "ctrl-o": "workspace::Open", // vim default: go back
      "ctrl-a": "editor::SelectAll" // vim default: increment
    }
  }
]

配置文件仓库:https://github.com/PushTracer/zed-configure-windows-vim