├── LICENSE ├── README.md ├── README_CN.md ├── imgs ├── .gitkeep ├── zed.png └── zed_logo.png ├── keymap.json └── settings.json /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Nexseer 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # zed-config 2 | 3 | 👉 English | [简体中文](README_CN.md) 4 | 5 | ![Logo](./imgs/zed_logo.png) 6 | 7 | - [I. What is Zed? 🧐](#i-what-is-zed-) 8 | - [II. Why Choose Zed? 😎](#ii-why-choose-zed-) 9 | - [1. Fast ⚡](#1-fast-) 10 | - [2. Intelligent 💻](#2-intelligent-) 11 | - [3. Collaborative 📶](#3-collaborative-) 12 | - [III. How to Use Zed? 😉](#iii-how-to-use-zed-) 13 | - [1. Quick Start 📝](#1-quick-start-) 14 | - [2. Custom Configuration ✍️](#2-custom-configuration-️) 15 | - [Vim Mode](#vim-mode) 16 | - [Proxy](#proxy) 17 | - [Theme Configuration](#theme-configuration) 18 | - [Appearance Configuration](#appearance-configuration) 19 | - [Basic Configuration](#basic-configuration) 20 | - [Development Configuration](#development-configuration) 21 | - [Telemetry Settings](#telemetry-settings) 22 | - [3. Shortcuts ⌨️](#3-shortcuts-️) 23 | - [System Default Shortcuts](#system-default-shortcuts) 24 | - [Custom Shortcuts](#custom-shortcuts) 25 | - [Built-in Vim Mode](#built-in-vim-mode) 26 | - [Shortcut Overview](#shortcut-overview) 27 | - [IV. Using AI 🌟](#iv-using-ai-) 28 | - [1. Supermaven Intelligent Completion ✨](#1-supermaven-intelligent-completion-) 29 | - [2. AI Assistant ⭐](#2-ai-assistant-) 30 | - [How to Enable Zed AI?](#how-to-enable-zed-ai) 31 | - [Assistant Panel](#assistant-panel) 32 | - [Inline Assistant](#inline-assistant) 33 | - [Prompting](#prompting) 34 | - [V. Collaboration 💥](#v-collaboration-) 35 | - [VI. Plugin Marketplace 🔌](#vi-plugin-marketplace-) 36 | 37 | ![zed](./imgs/zed.png) 38 | 39 | # I. What is Zed? 🧐 40 | 41 | > Zed is a next-generation code editor designed for high-performance collaboration with humans and AI. 42 | 43 | Zed Editor is a code editor that supports real-time collaboration, developed by Nathan Sobo, who was previously known for creating the Atom text editor while working at GitHub. Built with Rust at its core, Zed is designed for "high performance" 😮, excelling in areas such as input latency, startup time, and memory usage. 44 | 45 | Zed Editor enters the scene with a fresh visual appeal, aiming to provide developers with an efficient, smooth, and intuitive 👍 programming environment. 46 | 47 | > Founder Nathan's Views in the Interview 💭: 48 | > 49 | > "My dream tool needs to be both powerful and have a sleek, minimalist appearance, and it must run incredibly fast. However, achieving both ultra-fast speed and powerful functionality is challenging. I can say that most of my career has been spent trying to combine these two aspects, which is precisely Zed's goal. At the same time, we tend to adhere to minimalism in user experience." 50 | > 51 | > "I don't want to replace the command line experience with buttons; that doesn't make sense to me. I like being close to the machine, communicating with it in a language-like manner. I hope the IDE can recognize the existence of the terminal and command line and integrate them cleanly, rather than trying to define everything in a visual interface. As a natural extension and complement to the Unix philosophy, I think this suits me better. However, if I can run tests with a shortcut key instead of switching to the terminal, pressing the up arrow, and then Enter, I would gladly accept it. But I don't want it to hide the essence, because it's essentially running a command." 52 | > 53 | > "My goal has always been to create a lightweight, minimalist product that feels like a text editor but has the powerful features of an IDE, avoiding the laggy experience and bulky UI. This is what I wanted from the very beginning, and it should also be extensible." 54 | 55 | # II. Why Choose Zed? 😎 56 | 57 | ## 1. Fast ⚡ 58 | 59 | Zed Editor's lightweight design enables quick startup, making it an ideal choice for efficiency-focused developers. It emphasizes simplicity, focusing on speed and optimized resource usage, ensuring easy adoption without complex configurations. At the same time, it offers extensive customization options to meet the advanced needs of power users. 60 | 61 | ## 2. Intelligent 💻 62 | 63 | Zed Editor integrates AI-assisted coding features, enhancing the development experience by making it smarter and more efficient. Whether it's code completion, error detection, or automated refactoring, AI supports you at every step of your coding process. This intelligent assistance not only speeds up development but also reduces errors and repetitive tasks in manual coding. 64 | 65 | ## 3. Collaborative 📶 66 | 67 | Zed Editor's most modern feature is its support for team collaboration. By using Channels and CRDTs, it allows multiple developers to work on the same file simultaneously, facilitating real-time communication and collaboration within the development team. 68 | 69 | # III. How to Use Zed? 😉 70 | 71 | ## 1. Quick Start 📝 72 | 73 | Zed Editor currently supports MacOS and Linux systems, with official Windows support coming soon! On Mac, Zed supports versions from Catalina (10.15) to Sonoma (14.x). For Linux, you'll need to install the necessary dependencies—check out the [System Requirements - Zed](https://zed.dev/docs/system-requirements) for more details. 74 | 75 | 👉 [Install Zed on Linux](https://zed.dev/docs/linux) 76 | 77 | 👉 [Install Zed on Mac](https://zed.dev/docs/getting-started) 78 | 79 | The official Windows version of Zed Editor hasn't been released yet. 80 | 81 | However, there are a few ways to use Zed on Windows: 82 | 83 | 1. Compile it yourself or use a precompiled version from others. 84 | 2. Use WSL (Windows Subsystem for Linux) to run the Linux version of Zed Editor within WSL. 85 | 86 | ## 2. Custom Configuration ✍️ 87 | 88 | 👉 Official Guide: [Configuring Zed - Zed](https://zed.dev/docs/configuring-zed) 89 | 90 | 👉 Default Settings: [zed/assets/settings/default.json](https://github.com/pjlast/zed/blob/3273f5e4041f67b6703c07a14a1a106c03e36962/assets/settings/default.json) 91 | 92 | To open the `settings.json` file, you have two options: 93 | 94 | 1. Use the shortcut `Ctrl ,` 95 | 2. Open the command palette with `Ctrl Shift P` and type `zed: open settings` to open the `settings.json` file 96 | 97 | ### Vim Mode 98 | 99 | Zed Editor has built-in support for Vim mode. To enable it, add `"vim_mode": true,` to the `settings.json` file. 100 | 101 | ### Proxy 102 | 103 | To set up a proxy, add `"proxy": "http://127.0.0.1:7890",` to the `settings.json` file. This will facilitate the use of Zed AI. After making changes, close and restart Zed Editor to apply the new proxy settings. 104 | 105 | ### Theme Configuration 106 | 107 | 👉 Explore different themes: [Zed themes](https://zedz.dev/themes) 108 | 109 | 1. You can preview built-in themes via the `Theme` option in the dropdown menu under your avatar in the top-right corner. 110 | 2. To install theme plugins, go to `Extension` under the same menu. For instance, you can install the `base16` plugin and select the `snazzy` theme. 111 | 3. To customize themes, place a theme JSON file (like `zedspace.json` from [GitHub - Brunowilliang/zedspace](https://github.com/Brunowilliang/zedspace)) under `.config/zed/themes/`. Then, add the following to your `settings.json` file: 112 | 113 | ```json 114 | // Change the theme name 115 | "theme": { 116 | "mode": "dark", 117 | "light": "One Light", 118 | "dark": "ZedSpace Dark Theme" 119 | }, 120 | ``` 121 | 122 | 👉 For more configuration options, check out the official guide: [Themes - Zed](https://zed.dev/docs/themes) 123 | 124 | ### Appearance Configuration 125 | 126 | ```json 127 | "ui_font_size": 22, 128 | // Font style for the user interface (UI) 129 | "ui_font_family": "Cascadia Mono PL", 130 | "buffer_font_size": 26, 131 | // Font style for the code editing area (Buffer) 132 | "buffer_font_family": "JetBrains Mono", 133 | "buffer_font_weight": 500, 134 | "relative_line_numbers": true, 135 | // Hide navigation history buttons in the tab bar 136 | "tab_bar": { 137 | "show_nav_history_buttons": false 138 | }, 139 | // Enable file icons and Git status in tabs 140 | "tabs": { 141 | "file_icons": true, 142 | "git_status": true 143 | }, 144 | // Inlay hints settings 145 | "inlay_hints": { 146 | "enabled": true, 147 | "font_family": "Consolas" 148 | }, 149 | // Color by indentation level 150 | "indent_guides": { 151 | "coloring": "indent_aware" 152 | }, 153 | // Enable soft wrapping, automatically wrap lines when they exceed editor width 154 | "soft_wrap": "editor_width", 155 | ``` 156 | 157 | ### Basic Configuration 158 | 159 | Zed Editor comes with built-in formatting capabilities through the Language Server Protocol (LSP). 160 | 161 | ```json 162 | "tab_size": 2, 163 | // Enable auto-formatting on file save 164 | "format_on_save": "on", 165 | // Set vertical scroll margin 166 | "vertical_scroll_margin": 6, 167 | // Do not restore previous files or sessions on startup 168 | "restore_on_startup": "none", 169 | // Disable continuing comments on new lines 170 | "extend_comment_on_newline": false, 171 | // Associate specific file extensions with their respective file types 172 | "file_types": { 173 | "C++": ["c", "h", "cpp", "hpp"], 174 | "*.mdx": ["markdown"] 175 | }, 176 | // File and directory patterns to exclude during file scanning 177 | "file_scan_exclusions": [ 178 | "**/.git", 179 | "**/.svn", 180 | "**/.hg", 181 | "**/CVS", 182 | "**/.DS_Store", 183 | "**/Thumbs.db", 184 | "**/.classpath", 185 | "**/.settings", 186 | "**/vendor", 187 | "**/.tmp*" 188 | ], 189 | // Files and directories to exclude during search 190 | "search.exclude": { 191 | "**/*.snap": true, 192 | "**/.git": true, 193 | "**/.github": false, 194 | "**/.nuxt": true, 195 | "**/.output": true, 196 | "**/.pnpm": true, 197 | "**/.vscode": true, 198 | "**/.yarn": true, 199 | "**/node_modules": true, 200 | "**/out/**": true, 201 | "**/package-lock.json": true, 202 | "**/pnpm-lock.yaml": true, 203 | "**/temp": true, 204 | "**/yarn.lock": true, 205 | "**/CHANGELOG*": true, 206 | "**/LICENSE*": true 207 | }, 208 | "terminal": { 209 | "font_family": "Cascadia Code NF", 210 | "toolbar": { 211 | "title": false 212 | }, 213 | // Enable auto-copy to clipboard when text is selected in the terminal 214 | "copy_on_select": true 215 | }, 216 | "git": { 217 | // Enable Git integration 218 | "enabled": true, 219 | // Automatically fetch latest changes from remote repository periodically 220 | "autoFetch": true, 221 | // Set auto-fetch interval to 300 seconds (5 minutes) 222 | "autoFetchInterval": 300, 223 | // Automatically fetch latest Git changes when editor gains focus 224 | "autoFetchOnFocus": true, 225 | // Automatically fetch latest Git changes when switching editor windows 226 | "autoFetchOnWindowChange": true, 227 | // Automatically fetch latest Git changes during build events 228 | "autoFetchOnBuild": true, 229 | // Display Git status in the editor 230 | "git_status": true, 231 | // Auto-fetch Git changes during specific build events (e.g., build, run, debug) 232 | "autoFetchOnBuildEvents": [ 233 | "build", 234 | "run", 235 | "debug" 236 | ], 237 | // Delay auto-fetch by 1500 milliseconds (1.5 seconds) after build events 238 | "autoFetchOnBuildEventsDelay": 1500, 239 | // Delay auto-fetch by 1500 milliseconds (1.5 seconds) after build 240 | "autoFetchOnBuildDelay": 1500, 241 | // Display Git status in the editor's gutter, only for tracked files 242 | "git_gutter": "tracked_files", 243 | // Display inline blame with commit information beside code lines 244 | "inline_blame": { 245 | "enabled": false, 246 | "position": "right" 247 | } 248 | }, 249 | ``` 250 | 251 | > Note: You need to manually run the `git pull` command to merge changes ⛔ 252 | 253 | ### Development Configuration 254 | 255 | Zed Editor excels in language configuration, offering out-of-the-box support for multiple languages, automatic formatting, code completion, and more, greatly simplifying the setup process for developers. 256 | 257 | 👉 [Configuring Languages - Zed](https://zed.dev/docs/configuring-languages) 258 | 259 | 👉 [All Languages - Zed](https://zed.dev/docs/languages) 260 | 261 | - **`source.organizeImports: true`**: Automatically organize import statements during code formatting. 262 | - **`source.fixAll.eslint: true`**: Automatically fix all issues reported by ESLint during code formatting. 263 | 264 | In Rust, `check` is frequently used during daily coding, and `clippy` is used periodically or before code reviews. `clippy` is a lint tool for Rust that provides additional code style and error checks. 265 | 266 | ```json 267 | "languages": { 268 | "C++": { 269 | "formatter": { 270 | "external": { 271 | "command": "clang-format", 272 | "arguments": ["-style={BasedOnStyle: Google, IndentWidth: 2}"] 273 | } 274 | } 275 | }, 276 | "Go": { 277 | "code_actions_on_format": { 278 | "source.organizeImports": true 279 | } 280 | }, 281 | "Rust": { 282 | "tab_size": 2 283 | }, 284 | "TSX": { 285 | "formatter": { 286 | "external": { 287 | "command": "prettier", 288 | "arguments": ["--stdin-filepath", "{buffer_path}", "--tab-width", "2"] 289 | } 290 | }, 291 | "code_actions_on_format": { 292 | "source.organizeImports": true, 293 | "source.fixAll.eslint": true 294 | } 295 | }, 296 | "JavaScript": { 297 | "formatter": { 298 | "external": { 299 | "command": "prettier", 300 | "arguments": ["--stdin-filepath", "{buffer_path}", "--tab-width", "2"] 301 | } 302 | }, 303 | "code_actions_on_format": { 304 | "source.fixAll.eslint": true 305 | } 306 | }, 307 | "TypeScript": { 308 | "formatter": { 309 | "external": { 310 | "command": "prettier", 311 | "arguments": ["--stdin-filepath", "{buffer_path}", "--tab-width", "2"] 312 | } 313 | }, 314 | "code_actions_on_format": { 315 | "source.organizeImports": true, 316 | "source.fixAll.eslint": true 317 | } 318 | } 319 | }, 320 | 321 | "lsp": { 322 | "rust-analyzer": { 323 | "initialization_options": { 324 | "checkOnSave": { 325 | // rust-analyzer.check.command (default: "check") 326 | // "command": "clippy" 327 | } 328 | } 329 | }, 330 | "eslint": { 331 | "settings": { 332 | "codeActionOnSave": { 333 | "rules": ["import/order"] 334 | } 335 | } 336 | } 337 | } 338 | ``` 339 | 340 | ### Telemetry Settings 341 | 342 | Do not allow Zed Industries to collect anonymous usage data. 343 | 344 | ```json 345 | "telemetry": { 346 | "diagnostics": false, 347 | "metrics": false 348 | } 349 | ``` 350 | 351 | ## 3. Shortcuts ⌨️ 352 | 353 | Zed Editor’s key bindings are configured using `json/jsonc` format. For example: 354 | 355 | ```json 356 | [ 357 | { 358 | "context": "Workspace", 359 | "bindings": {} 360 | } 361 | ] 362 | ``` 363 | 364 | `context` specifies the conditions under which the corresponding key bindings will be active. 365 | 366 | - Pane 367 | - Workspace 368 | - Editor 369 | - Menu 370 | - Terminal 371 | - Assistant 372 | - ProjectPanel 373 | - ProjectSearch 374 | - BufferSearch 375 | - Search 376 | - Dock 377 | - EmptyPane 378 | - SharedScreen 379 | - VimControl 380 | - vim_mode == normal 381 | - vim_mode == visual 382 | - vim_mode == insert 383 | - vim_mode == replace 384 | - vim_mode == operator 385 | - vim_mode == waiting 386 | 387 | `bindings` specifies the key combinations; they can be strings, objects, or arrays. 388 | 389 | ### System Default Shortcuts 390 | 391 | To view the default keymap, open the command palette with `Ctrl Shift P`, then type `zed: open default keymap`. 392 | 393 | ### Custom Shortcuts 394 | 395 | To customize your shortcuts, type `zed: open keymap` to open the `keymap.json` file and make your modifications. 396 | 397 | ```json 398 | [ 399 | { 400 | "bindings": { 401 | "ctrl-shift-p": "command_palette::Toggle", 402 | "ctrl-shift-k": "zed::OpenKeymap", 403 | "ctrl-shift-x": "zed::Extensions", 404 | "f11": "zed::ToggleFullScreen", 405 | "ctrl-alt-n": "task::Spawn", 406 | "ctrl-alt-r": "task::Rerun", 407 | "ctrl-alt-o": "zed::OpenLocalTasks", 408 | "ctrl-\\": "workspace::NewCenterTerminal", 409 | "ctrl-t": "terminal_panel::ToggleFocus" 410 | } 411 | }, 412 | { 413 | "context": "Workspace", 414 | "bindings": { 415 | "shift shift": "workspace::NewSearch" 416 | } 417 | }, 418 | { 419 | "context": "Editor", 420 | "bindings": { 421 | "ctrl-a": "editor::SelectAll", 422 | "ctrl-w": "pane::CloseActiveItem", 423 | "alt-enter": "editor::ToggleCodeActions" 424 | } 425 | }, 426 | { 427 | "context": "Editor && VimControl && !VimWaiting && !menu", 428 | "bindings": { 429 | "H": "pane::ActivatePrevItem", 430 | "L": "pane::ActivateNextItem", 431 | "K": "editor::Hover", 432 | "g h": "editor::MoveToBeginningOfLine", 433 | "g l": "editor::MoveToEndOfLine", 434 | "g b": "pane::GoBack", 435 | "g r": "editor::GoToTypeDefinition", 436 | "g i": "editor::GoToImplementation", 437 | "space c f": "editor::Format", 438 | "space c r": "editor::Rename", 439 | "space e": "project_panel::ToggleFocus", 440 | "space f o": "outline::Toggle", 441 | "space f p": "projects::OpenRecent", 442 | "space f q": "file_finder::Toggle", 443 | "space g [": "editor::GoToPrevHunk", 444 | "space g ]": "editor::GoToHunk", 445 | "space g b": "editor::ToggleGitBlame", 446 | "space g d": "editor::ToggleHunkDiff", 447 | "space g r": "editor::RevertSelectedHunks", 448 | "space m o": "markdown::OpenPreview", 449 | "space m p": "markdown::OpenPreviewToTheSide", 450 | "space o": "tab_switcher::Toggle", 451 | "space p d": "diagnostics::Deploy", 452 | "space w c": "pane::CloseAllItems", 453 | "space w k": "pane::SplitUp", 454 | "space w j": "pane::SplitDown", 455 | "space w h": "pane::SplitLeft", 456 | "space w l": "pane::SplitRight" 457 | } 458 | }, 459 | { 460 | "context": "ProjectPanel && not_editing", 461 | "bindings": { 462 | "j": "menu::SelectNext", 463 | "k": "menu::SelectPrev", 464 | "a": "project_panel::NewFile", 465 | "A": "project_panel::NewDirectory", 466 | "c": "project_panel::Copy", 467 | "d": "project_panel::Delete", 468 | "p": "project_panel::Paste", 469 | "r": "project_panel::Rename", 470 | "x": "project_panel::Cut", 471 | "y p": "project_panel::CopyPath", 472 | "y r": "project_panel::CopyRelativePath" 473 | } 474 | }, 475 | { 476 | "context": "Dock || Terminal || Editor", 477 | "bindings": { 478 | "ctrl-h": ["workspace::ActivatePaneInDirection", "Left"], 479 | "ctrl-l": ["workspace::ActivatePaneInDirection", "Right"], 480 | "ctrl-k": ["workspace::ActivatePaneInDirection", "Up"], 481 | "ctrl-j": ["workspace::ActivatePaneInDirection", "Down"] 482 | } 483 | }, 484 | { 485 | "context": "Terminal", 486 | "bindings": { 487 | "ctrl-t": "workspace::ToggleBottomDock" 488 | } 489 | } 490 | ] 491 | ``` 492 | 493 | ### Built-in Vim Mode 494 | 495 | To view the default keymap for Vim mode, open the command palette with `Ctrl Shift P` and type `vim: open default keymap`. 496 | 497 | - The built-in `vim-surround` plugin allows you to modify or remove surrounding characters like single or double quotes: 498 | 499 | ``` 500 | ds 501 | cs 502 | 503 | # Remove the following [] 504 | [1, 2, 3] -> ds[ 505 | 506 | # Change the following [] to () 507 | [1, 2, 3] -> cs[( 508 | ``` 509 | 510 | - The built-in `vim-commentary` plugin enables toggling comments in visual mode with `gc` and in normal mode with `gcc`. 511 | - The built-in `netrw` plugin supports most keybindings in the project panel. 512 | 513 | ### Shortcut Overview 514 | 515 | **Global Shortcuts** 516 | 517 | | Shortcut | Function | 518 | | -------------- | ----------------------- | 519 | | `ctrl shift p` | Toggle command palette | 520 | | `ctrl shift k` | Open keymap settings | 521 | | `ctrl shift x` | Open extensions | 522 | | `F11` | Toggle full-screen mode | 523 | | `ctrl alt n` | Run task | 524 | | `ctrl alt r` | Rerun task | 525 | | `ctrl alt o` | Open local tasks | 526 | | `ctrl \` | Full-screen terminal | 527 | | `ctrl t` | Bottom terminal | 528 | 529 | **Workspace Shortcuts** 530 | 531 | | Shortcut | Function | 532 | | -------------- | ---------------------------------- | 533 | | `shift shift` | Universal search | 534 | | `ctrl n` | New file | 535 | | `ctrl s` | Save current file | 536 | | `ctrl shift s` | Save as | 537 | | `ctrl ?` | AI assistant panel | 538 | | `ctrl shift c` | Collaboration panel (non-terminal) | 539 | 540 | **Editor Shortcuts** 541 | 542 | | Shortcut | Function | 543 | | ----------- | -------------- | 544 | | `ctrl a` | Select all | 545 | | `ctrl w` | Close tab | 546 | | `ctrl y` | Redo | 547 | | `alt up` | Move line up | 548 | | `alt down` | Move line down | 549 | | `alt enter` | Code action | 550 | 551 | **Vim Mode Shortcuts** 552 | 553 | | Shortcut | Function | 554 | | ------------- | ----------------------------------- | 555 | | `{` | Move to start of paragraph | 556 | | `}` | Move to end of paragraph | 557 | | `/` | Search down from cursor | 558 | | `?` | Search up from cursor | 559 | | `n` | Next search match | 560 | | `N` | Previous search match | 561 | | `H` | Previous tab | 562 | | `L` | Next tab | 563 | | `K` | Show hover information | 564 | | `g h` | Move to start of line | 565 | | `g l` | Move to end of line | 566 | | `g b` | Go back to previous cursor position | 567 | | `g d` | Jump to definition | 568 | | `g D` | Jump to declaration | 569 | | `g r` | Jump to type definition | 570 | | `g i` | Jump to implementation | 571 | | `g A` | Find all references of current word | 572 | | `g s` | Find outline in current file | 573 | | `g S` | Find outline in entire project | 574 | | `g ]` | Jump to next diagnostic | 575 | | `g [` | Jump to previous diagnostic | 576 | | ` c f` | Format | 577 | | ` c r` | Rename | 578 | | ` e` | Open file explorer | 579 | | ` f o` | Find file outline | 580 | | ` f p` | Open recent project | 581 | | ` f q` | Quick open file in project | 582 | | ` g [` | Jump to previous Git change | 583 | | ` g ]` | Jump to next Git change | 584 | | ` g b` | Toggle `git blame` | 585 | | ` g d` | Toggle diff view of current `hunk` | 586 | | ` g r` | Revert selected `hunks` | 587 | | ` m o` | Open Markdown preview | 588 | | ` m p` | Open Markdown preview to the side | 589 | | ` o` | Tab switcher | 590 | | ` p d` | Error management panel | 591 | | ` w c` | Close all tabs | 592 | | ` w k` | Split panel upwards | 593 | | ` w j` | Split panel downwards | 594 | | ` w h` | Split panel left | 595 | | ` w l` | Split panel right | 596 | | `[ x` | Select previous syntax node | 597 | | `] x` | Select next syntax node | 598 | 599 | > `git blame` is a Git command used to trace the history of modifications in a specified file, showing the last modification information for each line. 600 | > 601 | > A `hunk` is a set of lines added, removed, or modified in a commit. 602 | > 603 | > `[ x` and `] x` commands use the syntax tree generated by Tree-sitter, allowing the code editor to intelligently select code blocks, improving editing and navigation efficiency. 604 | 605 | **Project Panel Shortcuts** 606 | 607 | | Shortcut | Function | 608 | | -------- | ------------------ | 609 | | `j` | Move down | 610 | | `k` | Move up | 611 | | `a` | New file | 612 | | `A` | New directory | 613 | | `c` | Copy | 614 | | `d` | Delete | 615 | | `p` | Paste | 616 | | `r` | Rename | 617 | | `x` | Cut | 618 | | `y p` | Copy path | 619 | | `y r` | Copy relative path | 620 | | `` | Return to Editor | 621 | 622 | **Panel Navigation Shortcuts** 623 | 624 | | Shortcut | Function | 625 | | -------- | -------------------- | 626 | | `ctrl h` | Jump to left panel | 627 | | `ctrl l` | Jump to right panel | 628 | | `ctrl k` | Jump to top panel | 629 | | `ctrl j` | Jump to bottom panel | 630 | 631 | **Multi-Cursor** 632 | 633 | To enable multi-cursor mode, hold down the Alt key and click the left mouse button to create cursors in multiple locations. 634 | 635 | | Shortcut | Function | 636 | | -------- | ---------------------------------------------------------- | 637 | | `g a` | Add visual selection for each instance of the current word | 638 | 639 | **Ex Commands** 640 | 641 | | Shortcut | Function | 642 | | --------------- | ------------------------ | 643 | | `:E[xplore]` | Open project panel | 644 | | `:C[ollab]` | Open collaboration panel | 645 | | `:Ch[at]` | Open chat panel | 646 | | `:A[I]` | Open AI panel | 647 | | `:No[tif]` | Open notifications panel | 648 | | `:fe[edback]` | Open feedback window | 649 | | `:cl[ist]` | Open diagnostics window | 650 | | `:te[rm]` | Open terminal | 651 | | `:Ext[ensions]` | Open extensions window | 652 | 653 | # IV. Using AI 🌟 654 | 655 | ## 1. Supermaven Intelligent Completion ✨ 656 | 657 | Supermaven — The FREE GitHub Copilot Alternative 658 | 659 | Add the following to your `settings.json` file: 660 | 661 | ```json 662 | "features": { 663 | "inline_completion_provider": "supermaven" 664 | } 665 | ``` 666 | 667 | Click the Supermaven icon in the bottom right corner to log in. 668 | 669 | | Shortcut | Function | 670 | | ------------ | ---------------------------------------------------------- | 671 | | `Tab` | Accept current inline completion | 672 | | `Ctrl Right` | Accept current inline completion to the next word boundary | 673 | | `Alt \` | Manually trigger inline completion request | 674 | 675 | ## 2. AI Assistant ⭐ 676 | 677 | 👉 [Configuring the Assistant](https://zed.dev/docs/assistant/configuration) 678 | 679 | Zed Editor supports the following AI assistants: 680 | 681 | - Zed AI 682 | - Anthropic 683 | - GitHub Copilot Chat 684 | - Google AI 685 | - Ollama 686 | - OpenAI 687 | 688 | 🎉 **Zed AI is currently free to use!!** 689 | 690 | 👉 [Introducing Zed AI](https://zed.dev/blog/zed-ai) 691 | 692 | > Zed AI is available now, free during our initial launch period. Sign in to Zed to access an AI-powered assistant panel and inline code transformations that integrate directly with your editing environment. 693 | 694 | Zed AI integrates LLMs directly into your editor with an extensible, text-centric approach. 695 | 696 | ### How to Enable Zed AI? 697 | 698 | 1. Sign in with your GitHub account. 699 | 2. Click the button in the bottom right corner or use the shortcut `Ctrl ?` to open the AI assistant. 700 | 3. Select the desired model. 701 | 4. Click `Send` and agree to the terms to start using it. 702 | 703 | ![image](https://github.com/user-attachments/assets/53cc4ac0-5b99-44f8-9e80-be0718984a89) 704 | 705 | ### Assistant Panel 706 | 707 | In the Assistant Panel, you can interact with large language models. 708 | 709 | - **`You`**: The content or questions input by the user. 710 | - **`Assistant`**: The responses and suggestions provided by the AI assistant. 711 | - **`System`**: System-level commands or configurations that set the context of the conversation and provide background information. 712 | 713 | ![image](https://github.com/user-attachments/assets/17fc1bca-5cf3-49ff-afd4-600e88fb6db0) 714 | 715 | 👉 Command details: [Commands - Zed](https://zed.dev/docs/assistant/commands) 716 | 717 | | Shortcut | Function | 718 | | -------------- | --------------------------------------------------------- | 719 | | `ctrl n` | Create a `context` | 720 | | `ctrl enter` | Confirm and send | 721 | | `ctrl shift >` | Insert selected text as a reference into the AI assistant | 722 | | `alt m` | Toggle model selector in the assistant panel | 723 | 724 | ### Inline Assistant 725 | 726 | Inline Assistant is an integrated real-time assistance tool within code editors. It analyzes the user's code and comments to understand the user's programming intent and specific challenges encountered. Based on this information, it provides context-aware assistance. This integration allows developers to receive the necessary help without leaving the editor environment, thereby improving programming efficiency. 727 | 728 | When you select code in the editor and press `Ctrl + Enter`, Inline Assistant is activated. This action triggers the tool to analyze the selected code and offer real-time suggestions or solutions. This feature helps developers quickly solve problems, optimize code, or understand complex programming concepts. 729 | 730 | In summary, Inline Assistant is a tool that can significantly enhance programming efficiency by seamlessly integrating into the code editor, offering context-aware assistance, and allowing developers to stay focused on writing high-quality code. 731 | 732 | ![image](https://github.com/user-attachments/assets/6ccb197e-4869-41c7-bf31-193544488358) 733 | 734 | ### Prompting 735 | 736 | Click the button to access the Prompt Library. 737 | 738 | ![image](https://github.com/user-attachments/assets/ecfa957d-4b9b-4138-9180-f5953e922b41) 739 | 740 | To add a custom prompt, refer to: 👉 [Cursor Directory](https://cursor.directory/) 741 | 742 | ![image](https://github.com/user-attachments/assets/b5de4b40-ebfa-444f-8a12-de5648784127) 743 | 744 | In the Assistant Panel, type `/prompt` followed by your custom prompt to quickly call it! 😘 745 | 746 | # V. Collaboration 💥 747 | 748 | > "The ideal collaborative environment should cover the entire lifecycle of code development." — Founder Nathan 749 | 750 | Collaboration has always been a key part of Zed Editor’s vision. From the very beginning, Zed Editor was built with CRDTs and text collaborative editing capabilities. Coding is no longer a solitary task but a creative, thought-provoking process. 751 | 752 | In the past, collaboration relied on GitHub, screen sharing, communication software, etc., but these methods disrupt your workflow. The ideal collaboration should always happen within the code editor, where all actions are centralized. 753 | 754 | 👉 [Channels - Zed](https://zed.dev/docs/channels) 755 | 756 | 👉 [Collaboration - Zed](https://zed.dev/docs/collaboration) 757 | 758 | > GitHub’s collaboration mode feels like sending emails; it’s an asynchronous information flow, which works well in some cases, so it remains a crucial collaboration method. 759 | 760 | # VI. Plugin Marketplace 🔌 761 | 762 | > "I would rather have a faster, less extensible Zed than let it become a bloated system." — Founder Nathan 763 | 764 | The Plugin Marketplace offers a wide range of plugins designed to extend the editor's functionality to meet the needs of different developers. 765 | 766 | You can install the necessary plugins through the `Extension` option in the dropdown menu under your avatar in the top right corner, or by using the custom shortcut `Ctrl Shift X`! 767 | 768 | Zed Editor extensions are compiled into WebAssembly (WASM). This design choice enhances performance and security while ensuring cross-platform compatibility. 769 | -------------------------------------------------------------------------------- /README_CN.md: -------------------------------------------------------------------------------- 1 | # 探索 Zed 编辑器:代码编辑器的未来 2 | 3 | 👉 [English](README.md) | 简体中文 4 | 5 | 视频解析:【探索 Zed 编辑器:代码编辑器的未来】 https://www.bilibili.com/video/BV1uvpseiEjk/?share_source=copy_web&vd_source=d33ea63980cbc6d87e0f6a8d93a6b9dc 6 | 7 | ![Logo](./imgs/zed_logo.png) 8 | 9 | - [一、Zed 是什么?🧐](#一zed-是什么) 10 | - [二、为什么选择 Zed ?😎](#二为什么选择-zed-) 11 | - [1. Fast ⚡](#1-fast-) 12 | - [2. Intelligent 💻](#2-intelligent-) 13 | - [3. Collaborative 📶](#3-collaborative-) 14 | - [三、怎么使用 Zed ? 😉](#三怎么使用-zed--) 15 | - [1. 快速入门 📝](#1-快速入门-) 16 | - [2. 自定义配置 ✍️](#2-自定义配置-️) 17 | - [Vim 模式](#vim-模式) 18 | - [代理](#代理) 19 | - [主题配置](#主题配置) 20 | - [外观配置](#外观配置) 21 | - [基础配置](#基础配置) 22 | - [开发配置](#开发配置) 23 | - [数据收集设置](#数据收集设置) 24 | - [3. 快捷键 ⌨️](#3-快捷键-️) 25 | - [系统默认快捷键](#系统默认快捷键) 26 | - [自定义快捷键](#自定义快捷键) 27 | - [Vim mode 内置](#vim-mode-内置) 28 | - [快捷键整理](#快捷键整理) 29 | - [四、AI 使用 🌟](#四ai-使用-) 30 | - [1. Supermaven 智能补全 ✨](#1-supermaven-智能补全-) 31 | - [2. AI Assistant ⭐](#2-ai-assistant-) 32 | - [如何开启Zed AI ?](#如何开启zed-ai-) 33 | - [Assistant Panel](#assistant-panel) 34 | - [Inline Assistant](#inline-assistant) 35 | - [Prompting](#prompting) 36 | - [五、协作 💥](#五协作-) 37 | - [六、插件商城 🔌](#六插件商城-) 38 | 39 | ![zed](./imgs/zed.png) 40 | 41 | # 一、Zed 是什么?🧐 42 | 43 | > Zed is a next-generation code editor designed for high-performance collaboration with humans and AI. 44 | 45 | Zed Editor 是一款支持多人协作的代码编辑器,由 Atom 编辑器的原作者主导开发,底层采用 Rust,主打 “高性能” 😮,无论是插入延迟、启动时间还是内存占用都十分优秀。 46 | 47 | Zed Editor 以一种全新的视觉美感进入人们的视野,其旨在为开发者提供一个高效、流畅、且直观的 👍 编程环境。 48 | 49 | > 创始人 Nathan 在访谈中的一些看法 💭: 50 | > 51 | > “我梦寐以求的工具既要功能强大,又要拥有简约时尚的外观,并且运行速度飞快。但是,超快的速度和强大的功能很难兼得。可以说我职业生涯的大部分时间都在努力实现这二者的结合,这正是 Zed 的目标。同时我们倾向于在用户体验上坚持简约主义。” 52 | > 53 | > “我不想用按钮取代命令行体验,那对我来说没什么意义。我喜欢接近机器,用语言的方式与它交流。我希望 IDE 能够意识到终端和命令行的存在并干净地集成它们,而不是试图在可视化界面里定义一切。作为 Unix 哲学的自然延伸和补充,我觉得这更适合我。但是,如果我可以通过一个快捷键来运行测试,而不是切换到终端,然后上下键选择再回车,那我很乐意接受它。但我不希望它隐藏了本质,因为这其实就是在运行一个命令。” 54 | > 55 | > “我一直以来的目标是打造一款轻量、简约、体验近似文本编辑器,但又拥有 IDE 强大功能的产品,尽量避免那种延迟的体验和笨重的 UI。这正是我很早之前就想要的,同时它还应该是可扩展的。” 56 | 57 | # 二、为什么选择 Zed ?😎 58 | 59 | ## 1. Fast ⚡ 60 | 61 | Zed Editor 的轻量级设计让它能够迅速启动,是注重效率的开发人员的理想选择。它以简约为核心,专注于速度和资源的优化利用,确保在不繁琐配置的情况下即可轻松上手。同时,它也提供了丰富的个性化选项,能够满足极客用户的高级需求。 62 | 63 | ## 2. Intelligent 💻 64 | 65 | Zed Editor 集成了 AI 辅助编码功能,使得开发体验更加智能化和高效。无论是代码补全、错误检测,还是自动重构,AI 都能在你编码的每一步提供帮助。这种智能辅助不仅加快了开发速度,还减少了手动编码中的错误和重复工作。 66 | 67 | ## 3. Collaborative 📶 68 | 69 | Zed Editor 最具现代化功能的是团队协作支持。其通过 Channel 和 CRDTs 来支持多人协作开发,意味着开发团队可以同时多人修改同一个文件,并可以同时进行交流讨论。 70 | 71 | > 更多的细节可以查看参考 📋 这篇文章:[Zed: 用 Rust 实现终极编辑器之梦](https://cloud.tencent.com/developer/article/2385576) 72 | 73 | # 三、怎么使用 Zed ? 😉 74 | 75 | ## 1. 快速入门 📝 76 | 77 | Zed Editor 目前支持 Mac 与 Linux 系统,后续会提供对于 Windows 系统的官方支持!!Mac 系统支持 `Catalina (10.15) - Sonoma (14.x)` 版本, Linux 系统需要安装相关依赖,查看 [System Requirements - Zed](https://zed.dev/docs/system-requirements) 。 78 | 79 | 👉 [Linux 安装 Zed](https://zed.dev/docs/linux) 80 | 81 | 👉 [Mac 安装 Zed](https://zed.dev/docs/getting-started) 82 | 83 | Zed Editor 官方尚未发布适用于 Windows 的版本。 84 | 85 | 不过,有几种方法可以在 Windows 上使用 Zed 编辑器: 86 | 87 | 1. 自行编译或用其他人编译好的; 88 | 2. 使用 WSL (Windows Subsystem for Linux):在 WSL 中运行 Zed Editor 的 Linux 版本。 89 | 90 | ## 2. 自定义配置 ✍️ 91 | 92 | 👉 官方手册:[Configuring Zed - Zed](https://zed.dev/docs/configuring-zed) 93 | 94 | 👉 官方默认设置:[zed/assets/settings/default.json](https://github.com/pjlast/zed/blob/3273f5e4041f67b6703c07a14a1a106c03e36962/assets/settings/default.json) 95 | 96 | 打开设置 `settings.json`,有以下两种办法: 97 | 98 | 1. 快捷键 `Ctrl ,` 99 | 100 | 2. 打开命令面板 `Crtl Shift P`,输入 `zed: open settings` 来打开 `settings.json` 文件。 101 | 102 | ### Vim 模式 103 | 104 | Zed Editor 原生支持 Vim 模式,在 `settings.json` 文件添加:`"vim_mode": true,` 105 | 106 | ### 代理 107 | 108 | 在 `settings.json` 文件添加:`"proxy": "http://127.0.0.1:7890",`,方便后续 Zed AI 的使用,关闭并重新启动Zed编辑器,使新的代理设置生效。 109 | 110 | ### 主题配置 111 | 112 | 👉 查看各种主题效果:[Zed themes](https://zedz.dev/themes) 113 | 114 | 1. 通过右上角头像下拉框中的 `Theme`,可以预览内置主题 115 | 2. 通过右上角头像下拉框中的 `Extension`,安装主题插件,我使用的就是 `base16` 插件,选择其中的 `snazzy` 主题 116 | 3. 自定义主题:将主题json文件(如[GitHub - Brunowilliang/zedspace](https://github.com/Brunowilliang/zedspace)中的`zedspace.json`)放置 `.config/zed/themes/` 下,在 `settings.json` 文件添加: 117 | 118 | ```json 119 | // 更换主题名 120 | "theme": { 121 | "mode": "dark", 122 | "light": "One Light", 123 | "dark": "ZedSpace Dark Theme" 124 | }, 125 | ``` 126 | 127 | 👉 更多配置查看官方手册:[Themes - Zed](https://zed.dev/docs/themes) 128 | 129 | ### 外观配置 130 | 131 | ```json 132 | "ui_font_size": 22, 133 | // 用户界面(UI)中的字体样式 134 | "ui_font_family": "Cascadia Mono PL", 135 | "buffer_font_size": 26, 136 | // 代码编辑区(Buffer)的字体样式 137 | "buffer_font_family": "JetBrains Mono", 138 | "buffer_font_weight": 500, 139 | "relative_line_numbers": true, 140 | // 隐藏标签栏中的导航历史按钮 141 | "tab_bar": { 142 | "show_nav_history_buttons": false 143 | }, 144 | // 启用文件图标显示,在标签页中显示文件类型对应的图标 145 | // 在标签页中显示文件的 Git 状态 146 | "tabs": { 147 | "file_icons": true, 148 | "git_status": true 149 | }, 150 | // 内联提示设置 151 | "inlay_hints": { 152 | "enabled": true, 153 | "font_family": "Consolas" 154 | }, 155 | // 根据缩进级别进行着色 156 | "indent_guides": { 157 | "coloring": "indent_aware" 158 | }, 159 | // 启用软换行,当行长度超过编辑器宽度时自动换行 160 | "soft_wrap": "editor_width", 161 | ``` 162 | 163 | ### 基础配置 164 | 165 | Zed Editor 内置格式化功能,通过语言服务器协议(LSP)来实现代码格式化。 166 | 167 | ```json 168 | "tab_size": 2, 169 | // 启用文件保存时自动格式化功能 170 | "format_on_save": "on", 171 | // 设置垂直滚动的边距 172 | "vertical_scroll_margin": 6, 173 | // 编辑器启动时不会自动恢复上次打开的文件或会话 174 | "restore_on_startup": "none", 175 | // 禁用在新行继续注释的功能 176 | "extend_comment_on_newline": false, 177 | // 将特定的文件扩展名与它们对应的文件类型进行关联 178 | "file_types": { 179 | "C++": ["c", "h", "cpp", "hpp"], 180 | "*.mdx": ["markdown"] 181 | }, 182 | // 文件扫描时要排除的文件和目录模式 183 | "file_scan_exclusions": [ 184 | "**/.git", 185 | "**/.svn", 186 | "**/.hg", 187 | "**/CVS", 188 | "**/.DS_Store", 189 | "**/Thumbs.db", 190 | "**/.classpath", 191 | "**/.settings", 192 | "**/vendor", 193 | "**/.tmp*" 194 | ], 195 | // 搜索时要排除的文件和目录 196 | "search.exclude": { 197 | "**/*.snap": true 198 | "**/.git": true 199 | "**/.github": false 200 | "**/.nuxt": true 201 | "**/.output": true 202 | "**/.pnpm": true 203 | "**/.vscode": true 204 | "**/.yarn": true 205 | "**/node_modules": true 206 | "**/out/**": true 207 | "**/package-lock.json": true 208 | "**/pnpm-lock.yaml": true 209 | "**/temp": true 210 | "**/yarn.lock": true 211 | "**/CHANGELOG*": true 212 | "**/LICENSE*": true 213 | }, 214 | "terminal": { 215 | "font_family": "Cascadia Code NF", 216 | "toolbar": { 217 | "title": false 218 | }, 219 | // 启用在终端中选择文本时自动复制到剪贴板的功能 220 | "copy_on_select": true 221 | }, 222 | "git": { 223 | // 启用 Git 集成功能 224 | "enabled": true, 225 | // 定期从远程仓库获取最新的更改 226 | "autoFetch": true, 227 | // 设置自动获取的时间间隔为 300 秒(5分钟) 228 | "autoFetchInterval": 300, 229 | // 当编辑器窗口获得焦点时自动获取最新的 Git 更改 230 | "autoFetchOnFocus": true, 231 | // 当编辑器窗口切换时自动获取最新的 Git 更改 232 | "autoFetchOnWindowChange": true, 233 | // 在构建项目时自动获取最新的 Git 更改 234 | "autoFetchOnBuild": true, 235 | // 在编辑器中显示文件的 Git 状态 236 | "git_status": true, 237 | // 在指定的构建事件(如构建、运行、调试)时自动获取最新的Git更改 238 | "autoFetchOnBuildEvents": [ 239 | "build", 240 | "run", 241 | "debug" 242 | ], 243 | // 设置在构建事件发生后延迟 1500 毫秒(1.5秒)再进行自动获取 244 | "autoFetchOnBuildEventsDelay": 1500, 245 | // 设置在构建后延迟 1500 毫秒(1.5秒)再进行自动获取 246 | "autoFetchOnBuildDelay": 1500, 247 | // 在编辑器的行号栏(gutter)中显示 Git 状态,仅显示已跟踪文件的状态 248 | "git_gutter": "tracked_files", 249 | // ,在代码行旁边显示最后一次修改该行的提交信息 250 | "inline_blame": { 251 | "enabled": false, 252 | "position": "right" 253 | } 254 | }, 255 | ``` 256 | 257 | > 需要手动执行 git pull 命令来合并更改 ⛔ 258 | 259 | ### 开发配置 260 | 261 | Zed Editor 在语言配置方面做得非常好,提供了开箱即用的多语言支持、自动格式化、代码补全等功能,极大地简化了开发者的配置工作。 262 | 263 | 👉 [Configuring Languages - Zed](https://zed.dev/docs/configuring-languages) 264 | 265 | 👉 [All Languages - Zed](https://zed.dev/docs/languages) 266 | 267 | - **`source.organizeImports: true`**:在格式化代码时自动整理导入语句。 268 | - **`source.fixAll.eslint: true`**:在格式化代码时自动修复所有 ESLint 报告的问题。 269 | 270 | Rust 中日常编码中频繁使用 `check`,定期或在代码审查前使用 `clippy`。`clippy` 是 Rust 的一个 lint 工具,提供了更多的代码风格和错误检查。 271 | 272 | ```json 273 | "languages": { 274 | "C++": { 275 | "formatter": { 276 | "external": { 277 | "command": "clang-format", 278 | "arguments": ["-style={BasedOnStyle: Google, IndentWidth: 2}"] 279 | } 280 | } 281 | }, 282 | "Go": { 283 | "code_actions_on_format": { 284 | "source.organizeImports": true 285 | } 286 | }, 287 | "Rust": { 288 | "tab_size": 2 289 | }, 290 | "TSX": { 291 | "formatter": { 292 | "external": { 293 | "command": "prettier", 294 | "arguments": ["--stdin-filepath", "{buffer_path}", "--tab-width", "2"] 295 | } 296 | }, 297 | "code_actions_on_format": { 298 | "source.organizeImports": true, 299 | "source.fixAll.eslint": true 300 | } 301 | }, 302 | "JavaScript": { 303 | "formatter": { 304 | "external": { 305 | "command": "prettier", 306 | "arguments": ["--stdin-filepath", "{buffer_path}", "--tab-width", "2"] 307 | } 308 | }, 309 | "code_actions_on_format": { 310 | "source.fixAll.eslint": true 311 | } 312 | }, 313 | "TypeScript": { 314 | "formatter": { 315 | "external": { 316 | "command": "prettier", 317 | "arguments": ["--stdin-filepath", "{buffer_path}", "--tab-width", "2"] 318 | } 319 | }, 320 | "code_actions_on_format": { 321 | "source.organizeImports": true, 322 | "source.fixAll.eslint": true 323 | } 324 | } 325 | }, 326 | 327 | "lsp": { 328 | "rust-analyzer": { 329 | "initialization_options": { 330 | "checkOnSave": { 331 | // rust-analyzer.check.command (default: "check") 332 | // "command": "clippy" 333 | } 334 | } 335 | }, 336 | "eslint": { 337 | "settings": { 338 | "codeActionOnSave": { 339 | "rules": ["import/order"] 340 | } 341 | } 342 | } 343 | } 344 | ``` 345 | 346 | ### 数据收集设置 347 | 348 | 不允许 Zed Industries 收集匿名使用数据~ 349 | 350 | ```json 351 | "telemetry": { 352 | "diagnostics": false, 353 | "metrics": false 354 | } 355 | ``` 356 | 357 | ## 3. 快捷键 ⌨️ 358 | 359 | Zed Editor 的快捷键配置([Key bindings - Zed](https://zed.dev/docs/key-bindings))以 `json/jsonc` 作为配置格式,形式如下: 360 | 361 | ```json 362 | [ 363 | { 364 | "context": "Workspace", 365 | "bindings": {} 366 | } 367 | ] 368 | ``` 369 | 370 | `context` 上下文条件,只有在满足特定的上下文条件下,对应的快捷键绑定才会生效。 371 | 372 | - Pane 373 | - Workspace 374 | - Editor 375 | - Menu 376 | - Terminal 377 | - Assistant 378 | - ProjectPanel 379 | - ProjectSearch 380 | - BufferSearch 381 | - Search 382 | - Dock 383 | - EmptyPane 384 | - SharedScreen 385 | - VimControl 386 | - vim_mode == normal 387 | - vim_mode == visual 388 | - vim_mode == insert 389 | - vim_mode == replace 390 | - vim_mode == operator 391 | - vim_mode == waiting 392 | 393 | `bindings` 顾名思义,指定的快捷键;类型可以是字符串、对象、数组。 394 | 395 | ### 系统默认快捷键 396 | 397 | 打开命令面板 `Crtl Shift P`,输入 `zed: open default keymap`,打开默认键位映射文件。 398 | 399 | ### 自定义快捷键 400 | 401 | 输入 `zed: open keymap` 来打开 `keymap.json` 文件,进行自定义修改。 402 | 403 | ```json 404 | [ 405 | { 406 | "bindings": { 407 | "ctrl-shift-p": "command_palette::Toggle", 408 | "ctrl-shift-k": "zed::OpenKeymap", 409 | "ctrl-shift-x": "zed::Extensions", 410 | "f11": "zed::ToggleFullScreen", 411 | "ctrl-alt-n": "task::Spawn", 412 | "ctrl-alt-r": "task::Rerun", 413 | "ctrl-alt-o": "zed::OpenLocalTasks", 414 | "ctrl-\\": "workspace::NewCenterTerminal", 415 | "ctrl-t": "terminal_panel::ToggleFocus" 416 | } 417 | }, 418 | { 419 | "context": "Workspace", 420 | "bindings": { 421 | "shift shift": "workspace::NewSearch" 422 | } 423 | }, 424 | { 425 | "context": "Editor", 426 | "bindings": { 427 | "ctrl-a": "editor::SelectAll", 428 | "ctrl-w": "pane::CloseActiveItem", 429 | "alt-enter": "editor::ToggleCodeActions" 430 | } 431 | }, 432 | { 433 | "context": "Editor && VimControl && !VimWaiting && !menu", 434 | "bindings": { 435 | "H": "pane::ActivatePrevItem", 436 | "L": "pane::ActivateNextItem", 437 | "K": "editor::Hover", 438 | "g h": "editor::MoveToBeginningOfLine", 439 | "g l": "editor::MoveToEndOfLine", 440 | "g b": "pane::GoBack", 441 | "g r": "editor::GoToTypeDefinition", 442 | "g i": "editor::GoToImplementation", 443 | "space c f": "editor::Format", 444 | "space c r": "editor::Rename", 445 | "space e": "project_panel::ToggleFocus", 446 | "space f o": "outline::Toggle", 447 | "space f p": "projects::OpenRecent", 448 | "space f q": "file_finder::Toggle", 449 | "space g [": "editor::GoToPrevHunk", 450 | "space g ]": "editor::GoToHunk", 451 | "space g b": "editor::ToggleGitBlame", 452 | "space g d": "editor::ToggleHunkDiff", 453 | "space g r": "editor::RevertSelectedHunks", 454 | "space m o": "markdown::OpenPreview", 455 | "space m p": "markdown::OpenPreviewToTheSide", 456 | "space o": "tab_switcher::Toggle", 457 | "space p d": "diagnostics::Deploy", 458 | "space w c": "pane::CloseAllItems", 459 | "space w k": "pane::SplitUp", 460 | "space w j": "pane::SplitDown", 461 | "space w h": "pane::SplitLeft", 462 | "space w l": "pane::SplitRight" 463 | } 464 | }, 465 | { 466 | "context": "ProjectPanel && not_editing", 467 | "bindings": { 468 | "j": "menu::SelectNext", 469 | "k": "menu::SelectPrev", 470 | "a": "project_panel::NewFile", 471 | "A": "project_panel::NewDirectory", 472 | "c": "project_panel::Copy", 473 | "d": "project_panel::Delete", 474 | "p": "project_panel::Paste", 475 | "r": "project_panel::Rename", 476 | "x": "project_panel::Cut", 477 | "y p": "project_panel::CopyPath", 478 | "y r": "project_panel::CopyRelativePath" 479 | } 480 | }, 481 | { 482 | "context": "Dock || Terminal || Editor", 483 | "bindings": { 484 | "ctrl-h": ["workspace::ActivatePaneInDirection", "Left"], 485 | "ctrl-l": ["workspace::ActivatePaneInDirection", "Right"], 486 | "ctrl-k": ["workspace::ActivatePaneInDirection", "Up"], 487 | "ctrl-j": ["workspace::ActivatePaneInDirection", "Down"] 488 | } 489 | }, 490 | { 491 | "context": "Terminal", 492 | "bindings": { 493 | "ctrl-t": "workspace::ToggleBottomDock" 494 | } 495 | } 496 | ] 497 | ``` 498 | 499 | ### Vim mode 内置 500 | 501 | 打开命令面板 `Crtl Shift P`,输入 `vim: open default keymap`,打开 Vim 模式下的默认键位映射文件。 502 | 503 | - 内置的 `vim-surround` 插件,如果你想修改、或者删除单引号和双引号: 504 | 505 | ``` 506 | ds 507 | cs 508 | 509 | # 删除以下的[] 510 | [1, 2, 3] -> ds[ 511 | 512 | # 将以下的[]修改为() 513 | [1, 2, 3] -> cs[( 514 | ``` 515 | 516 | - 内置的 `vim-commentary` 插件,可视模式下的 `gc` 和普通模式下的 `gcc` 起切换注释作用。 517 | 518 | - 内置的 `netrw` 插件,项目面板支持大多数按键绑定。 519 | 520 | ### 快捷键整理 521 | 522 | **全局快捷键** 523 | 524 | | 快捷键 | 功能 | 525 | | -------------- | -------------- | 526 | | `ctrl shift p` | 切换命令面板 | 527 | | `ctrl shift k` | 打开快捷键设置 | 528 | | `ctrl shift x` | 打开扩展插件 | 529 | | `F11` | 切换全屏模式 | 530 | | `ctrl alt n` | 运行任务 | 531 | | `ctrl alt r` | 重新运行任务 | 532 | | `ctrl alt o` | 打开本地任务 | 533 | | `ctrl \` | 全屏终端 | 534 | | `ctrl t` | 底部终端 | 535 | 536 | **工作区(Workspace)快捷键** 537 | 538 | | 快捷键 | 功能 | 539 | | -------------- | ------------------------ | 540 | | `shift shift` | 万能搜索 | 541 | | `ctrl n` | 新建文件 | 542 | | `ctrl s` | 保存当前文件 | 543 | | `ctrl shift s` | 另存为 | 544 | | `ctrl ?` | AI 助手面板 | 545 | | `ctrl shift c` | 协作面板(非终端下生效) | 546 | 547 | **编辑器(Editor)快捷键** 548 | 549 | | 快捷键 | 功能 | 550 | | ----------- | ------------ | 551 | | `ctrl a` | 全选 | 552 | | `ctrl w` | 关闭标签页 | 553 | | `ctrl y` | 取消撤回操作 | 554 | | `alt up` | 向上移动行 | 555 | | `alt down` | 向下移动行 | 556 | | `alt enter` | 代码操作 | 557 | 558 | **Vim 模式快捷键** 559 | 560 | | 快捷键 | 功能 | 561 | | ------------- | -------------------------------- | 562 | | `{` | 移动到段落的开始 | 563 | | `}` | 移动到段落的结束 | 564 | | `/` | 从光标当前位置向下搜索 | 565 | | `?` | 从光标当前位置向上搜索 | 566 | | `n` | 下一个搜索匹配项 | 567 | | `N` | 上一个搜索匹配项 | 568 | | `H` | 上一个标签页 | 569 | | `L` | 下一个标签页 | 570 | | `K` | 显示悬停信息 | 571 | | `g h` | 移动到行首 | 572 | | `g l` | 移动到行尾 | 573 | | `g b` | 返回到上一个光标位置 | 574 | | `g d` | 跳转到定义 | 575 | | `g D` | 跳转到声明 | 576 | | `g r` | 跳转到类型定义 | 577 | | `g i` | 跳转到实现 | 578 | | `g A` | 跳转到当前单词的所有引用 | 579 | | `g s` | 在当前文件中查找大纲 | 580 | | `g S` | 在整个项目中查找大纲 | 581 | | `g ]` | 跳转到下一个诊断 | 582 | | `g [` | 跳转到上一个诊断 | 583 | | ` c f` | 格式化 | 584 | | ` c r` | 重命名 | 585 | | ` e` | 打开文件资源管理器 | 586 | | ` f o` | 查找文件大纲 | 587 | | ` f p` | 打开最近的项目 | 588 | | ` f q` | 快速打开项目下的文件 | 589 | | ` g [` | 跳转到上一个 Git 更改 | 590 | | ` g ]` | 跳转到下一个 Git 更改 | 591 | | ` g b` | 切换`git blame` | 592 | | ` g d` | 切换显示当前 `hunk` 的差异 | 593 | | ` g r` | 还原选定的 `hunks` | 594 | | ` m o` | 打开 Markdown 预览 | 595 | | ` m p` | 在侧边打开 Markdown 预览 | 596 | | ` o` | 标签切换 | 597 | | ` p d` | 错误管理面板 | 598 | | ` w c` | 关闭所有标签页 | 599 | | ` w k` | 向上分割面板 | 600 | | ` w j` | 向下分割面板 | 601 | | ` w h` | 向左分割面板 | 602 | | ` w l` | 向右分割面板 | 603 | | `[ x` | 选择上一级语法节点,扩大选择范围 | 604 | | `] x` | 选择下一级语法节点,缩小选择范围 | 605 | 606 | > `git blame` 是 Git 中的一个命令,用于追溯指定文件的历史修改记录。它可以显示文件中每一行代码的最后一次修改信息,包括提交哈希值、作者、日期和时间。 607 | > 608 | > `hunk` 包含了在某个提交中被添加、删除或修改的行。 609 | > 610 | > `[ x` 与 `] x` 命令利用 Tree-sitter 生成的语法树,使得代码编辑器能够智能地选择代码块,从而提高代码编辑和导航的效率。 611 | 612 | **项目面板(Project Panel)快捷键** 613 | 614 | | 快捷键 | 功能 | 615 | | ------- | ------------ | 616 | | `j` | 向下 | 617 | | `k` | 向上 | 618 | | `a` | 新建文件 | 619 | | `A` | 新建目录 | 620 | | `c` | 复制 | 621 | | `d` | 删除 | 622 | | `p` | 粘贴 | 623 | | `r` | 重命名 | 624 | | `x` | 剪切 | 625 | | `y p` | 复制路径 | 626 | | `y r` | 复制相对路径 | 627 | | `` | 返回 Editor | 628 | 629 | **面板导航快捷键** 630 | 631 | | 快捷键 | 功能 | 632 | | -------- | -------------- | 633 | | `ctrl h` | 跳转到左侧面板 | 634 | | `ctrl l` | 跳转到右侧面板 | 635 | | `ctrl k` | 跳转到上方面板 | 636 | | `ctrl j` | 跳转到下方面板 | 637 | 638 | **多光标** 639 | 640 | 启动多光标模式:按住 Alt 键并点击鼠标左键,可以在多个位置创建光标。 641 | 642 | | 快捷键 | 功能 | 643 | | ------ | -------------------------------- | 644 | | `g a` | 光标当前词的每个副本添加可视选择 | 645 | 646 | **Ex 命令** 647 | 648 | | 快捷键 | 功能 | 649 | | --------------- | ------------ | 650 | | `:E[xplore]` | 打开项目面板 | 651 | | `:C[ollab]` | 打开协作面板 | 652 | | `:Ch[at]` | 打开聊天面板 | 653 | | `:A[I]` | 打开 AI 面板 | 654 | | `:No[tif]` | 打开通知面板 | 655 | | `:fe[edback]` | 打开反馈窗口 | 656 | | `:cl[ist]` | 打开诊断窗口 | 657 | | `:te[rm]` | 打开终端 | 658 | | `:Ext[ensions]` | 打开扩展窗口 | 659 | 660 | # 四、AI 使用 🌟 661 | 662 | ## 1. Supermaven 智能补全 ✨ 663 | 664 | Supermaven —— The FREE GitHub Copilot Alternative 665 | 666 | 在 `settings.json` 文件添加: 667 | 668 | ```json 669 | "features": { 670 | "inline_completion_provider": "supermaven" 671 | } 672 | ``` 673 | 674 | 点击右下角状态栏中的 Supermaven 图标以登录。 675 | 676 | | 快捷键 | 功能 | 677 | | ------------ | ------------------------------------ | 678 | | `tab` | 接受当前的内联补全 | 679 | | `ctrl right` | 接受当前内联补全,直至下一个单词边界 | 680 | | `alt \` | 手动触发内联补全请求 | 681 | 682 | ## 2. AI Assistant ⭐ 683 | 684 | 👉 [Configurating the Assistant](https://zed.dev/docs/assistant/configuration) 685 | 686 | Zed editor 支持以下: 687 | 688 | - Zed AI 689 | - Anthropic 690 | - GitHub Copilot Chat 691 | - Google AI 692 | - Ollama 693 | - OpenAI 694 | 695 | 🎉 **Zed AI 目前可以免费使用!!** 696 | 697 | 👉 [Introducing Zed AI](https://zed.dev/blog/zed-ai) 698 | 699 | > Zed AI is available now, free during our initial launch period. Sign in to Zed to access an AI-powered assistant panel and inline code transformations that integrate directly with your editing environment. 700 | 701 | Zed AI brings LLMs directly into your editor with an extensible, text-centric approach. 702 | 703 | Zed AI 通过可扩展的、以文本为中心的方法将 LLM 直接引入您的编辑器。 704 | 705 | ### 如何开启Zed AI ? 706 | 707 | 1. GitHub 帐户登录 708 | 709 | 2. 点击右下角按钮或者快捷键 `ctrl ?` 打开 AI 助手 710 | 711 | 3. 选择对应的模型 712 | 713 | 4. 点击 `Send`,同意相关协议即可使用 714 | 715 | ![image](https://github.com/user-attachments/assets/82b6199d-d6b6-4426-8fcd-ddbb3a99f9ed) 716 | 717 | ### Assistant Panel 718 | 719 | 在助手面板你可以与大语言模型进行互动 720 | 721 | - **`You`**: 用户输入的内容或提出的问题。 722 | - **`Assistant`**: AI 助手提供的响应和建议。 723 | - **`System`**: 系统级别的指令或配置,用于设置对话上下文和提供背景信息。 724 | 725 | ![image](https://github.com/user-attachments/assets/b2aed8de-7448-42f8-b97f-5f980e120835) 726 | 727 | 👉 命令详情:[Commands - Zed](https://zed.dev/docs/assistant/commands) 728 | 729 | | 快捷键 | 功能 | 730 | | -------------- | ------------------------------ | 731 | | `ctrl n` | 创建 `context` | 732 | | `ctrl enter` | 确认发送 | 733 | | `ctrl shift >` | 将选中文本作为引用插入 AI 助手 | 734 | | `alt m` | 助手面板切换模型选择器 | 735 | 736 | ### Inline Assistant 737 | 738 | Inline Assistant 是一种集成在代码编辑器中的实时辅助工具,它通过分析用户的代码和注释,理解用户的编程意图和遇到的具体问题。然后,它根据这些信息提供上下文相关的帮助。这样的集成方式允许开发者无需离开编辑器环境,即可获得必要的帮助,从而提高编程效率。 739 | 740 | 当你在编辑器中选中代码后,按下 `Ctrl + Enter` 即可激活 Inline Assistant。这种操作将触发工具对选中代码进行分析,并提供实时的建议或解决方案。这有助于开发者快速解决问题、优化代码或理解某些复杂的编程概念。 741 | 742 | 总之,Inline Assistant 是一种能够显著提升编程效率的工具,通过无缝集成到代码编辑器中,提供上下文相关的帮助,让开发者更加专注于编写高质量的代码。 743 | 744 | ![image](https://github.com/user-attachments/assets/6ccb197e-4869-41c7-bf31-193544488358) 745 | 746 | 747 | ### Prompting 748 | 749 | 点击按钮进入 Prompt Library 750 | 751 | ![image](https://github.com/user-attachments/assets/e5685a24-f6c6-4c07-b065-b18bd1328b6f) 752 | 753 | 设置添加 Prompt:👉 [Cursor Directory](https://cursor.directory/) 进行参考 754 | 755 | ![image](https://github.com/user-attachments/assets/fc4fb973-efff-44b3-a8fa-7a7c2af714ff) 756 | 757 | 在 Assistant Panel 中 输入 `/prompt` + `自定义 Prompt` 即可快速调用!😘 758 | 759 | # 五、协作 💥 760 | 761 | > “理想的协作环境应该涵盖整个代码开发的生命周期。” —— 创始人 Nathan 762 | 763 | 协作一直是 Zed Editor 愿景的重要组成部分。从一开始构建 Zed Editor 时就融入了 CRDTs 和文本协同编辑功能。至此编写代码不再是一项孤独的任务,而是一个创造性的、激发思维的过程。 764 | 765 | 在过去,协作依赖于 Github、屏幕共享、通讯软件等方式,但这会影响你工作的流畅,而你理想中的协作应该始终在代码编辑器中进行,所有操作都集中在此。 766 | 767 | 👉 [Channels - Zed](https://zed.dev/docs/channels) 768 | 769 | 👉 [Collaboration - Zed](https://zed.dev/docs/collaboration) 770 | 771 | > GitHub 的协作模式感觉像是在发电子邮件,它是异步的信息流,这种方式确实适用于某些情况,所以仍然是一种至关重要的协作方式。 772 | 773 | # 六、插件商城 🔌 774 | 775 | > “那么我宁愿拥有一个更快的、扩展更少的 Zed,也不愿让它变成一个臃肿的系统”。—— 创始人 Nathan 776 | 777 | 插件商城中丰富的插件,旨在扩展编辑器的功能,满足不同开发者的需求。 778 | 779 | 通过右上角头像下拉框中的 `Extension` 或者使用自定义的快捷键 `ctrl shift x`,安装需要的插件!! 780 | 781 | Zed Editor 扩展是被编译打包为 WebAssembly (WASM)。这种设计选择有助于提高扩展的性能和安全性,同时也确保了跨平台兼容性。 782 | -------------------------------------------------------------------------------- /imgs/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /imgs/zed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nexseer/zed-config/03d744129367c7cc83945a6be69080bb82ee2e87/imgs/zed.png -------------------------------------------------------------------------------- /imgs/zed_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nexseer/zed-config/03d744129367c7cc83945a6be69080bb82ee2e87/imgs/zed_logo.png -------------------------------------------------------------------------------- /keymap.json: -------------------------------------------------------------------------------- 1 | // Zed keymap 2 | // 3 | // For information on binding keys, see the Zed 4 | // documentation: https://zed.dev/docs/key-bindings 5 | // 6 | // To see the default key bindings run `zed: open default keymap` 7 | // from the command palette. 8 | [ 9 | { 10 | "bindings": { 11 | "ctrl-shift-p": "command_palette::Toggle", 12 | "ctrl-shift-k": "zed::OpenKeymap", 13 | "ctrl-shift-x": "zed::Extensions", 14 | "f11": "zed::ToggleFullScreen", 15 | "ctrl-alt-n": "task::Spawn", 16 | "ctrl-alt-r": "task::Rerun", 17 | "ctrl-alt-o": "zed::OpenLocalTasks", 18 | "ctrl-\\": "workspace::NewCenterTerminal", 19 | "ctrl-t": "terminal_panel::ToggleFocus" 20 | } 21 | }, 22 | { 23 | "context": "Workspace", 24 | "bindings": { 25 | "shift shift": "workspace::NewSearch" 26 | } 27 | }, 28 | { 29 | "context": "Editor", 30 | "bindings": { 31 | "ctrl-a": "editor::SelectAll", 32 | "ctrl-w": "pane::CloseActiveItem", 33 | "alt-enter": "editor::ToggleCodeActions" 34 | } 35 | }, 36 | { 37 | "context": "Editor && VimControl && !VimWaiting && !menu", 38 | "bindings": { 39 | "H": "pane::ActivatePrevItem", 40 | "L": "pane::ActivateNextItem", 41 | "K": "editor::Hover", 42 | "g h": "editor::MoveToBeginningOfLine", 43 | "g l": "editor::MoveToEndOfLine", 44 | "g b": "pane::GoBack", 45 | "g r": "editor::GoToTypeDefinition", 46 | "g i": "editor::GoToImplementation", 47 | "space c f": "editor::Format", 48 | "space c r": "editor::Rename", 49 | "space e": "project_panel::ToggleFocus", 50 | "space f o": "outline::Toggle", 51 | "space f p": "projects::OpenRecent", 52 | "space f q": "file_finder::Toggle", 53 | "space g [": "editor::GoToPrevHunk", 54 | "space g ]": "editor::GoToHunk", 55 | "space g b": "editor::ToggleGitBlame", 56 | "space g d": "editor::ToggleHunkDiff", 57 | "space g r": "editor::RevertSelectedHunks", 58 | "space m o": "markdown::OpenPreview", 59 | "space m p": "markdown::OpenPreviewToTheSide", 60 | "space o": "tab_switcher::Toggle", 61 | "space p d": "diagnostics::Deploy", 62 | "space w c": "pane::CloseAllItems", 63 | "space w k": "pane::SplitUp", 64 | "space w j": "pane::SplitDown", 65 | "space w h": "pane::SplitLeft", 66 | "space w l": "pane::SplitRight" 67 | } 68 | }, 69 | { 70 | "context": "ProjectPanel && not_editing", 71 | "bindings": { 72 | "j": "menu::SelectNext", 73 | "k": "menu::SelectPrev", 74 | "a": "project_panel::NewFile", 75 | "A": "project_panel::NewDirectory", 76 | "c": "project_panel::Copy", 77 | "d": "project_panel::Delete", 78 | "p": "project_panel::Paste", 79 | "r": "project_panel::Rename", 80 | "x": "project_panel::Cut", 81 | "y p": "project_panel::CopyPath", 82 | "y r": "project_panel::CopyRelativePath" 83 | } 84 | }, 85 | { 86 | "context": "Dock || Terminal || Editor", 87 | "bindings": { 88 | "ctrl-h": ["workspace::ActivatePaneInDirection", "Left"], 89 | "ctrl-l": ["workspace::ActivatePaneInDirection", "Right"], 90 | "ctrl-k": ["workspace::ActivatePaneInDirection", "Up"], 91 | "ctrl-j": ["workspace::ActivatePaneInDirection", "Down"] 92 | } 93 | }, 94 | { 95 | "context": "Terminal", 96 | "bindings": { 97 | "ctrl-t": "workspace::ToggleBottomDock" 98 | } 99 | } 100 | ] 101 | -------------------------------------------------------------------------------- /settings.json: -------------------------------------------------------------------------------- 1 | // Zed settings 2 | // 3 | // For information on how to configure Zed, see the Zed 4 | // documentation: https://zed.dev/docs/configuring-zed 5 | // 6 | // To see all of Zed's default settings without changing your 7 | // custom settings, run `zed: open default settings` from the 8 | // command palette 9 | { 10 | "assistant": { 11 | "default_model": { 12 | "provider": "zed.dev", 13 | "model": "claude-3-7-sonnet-latest" 14 | }, 15 | "version": "2" 16 | }, 17 | "proxy": "http://127.0.0.1:20171", 18 | "vim_mode": true, 19 | "theme": { 20 | "mode": "dark", 21 | "light": "One Light", 22 | "dark": "Base16 Snazzy" 23 | }, 24 | 25 | "ui_font_size": 22, 26 | "ui_font_family": "Cascadia Code", 27 | "buffer_font_size": 28, 28 | "buffer_font_family": "JetBrains Mono", 29 | "buffer_font_weight": 500, 30 | "relative_line_numbers": true, 31 | "tab_bar": { 32 | "show_nav_history_buttons": false 33 | }, 34 | "tabs": { 35 | "file_icons": true, 36 | "git_status": true 37 | }, 38 | "inlay_hints": { 39 | "enabled": true, 40 | "font_family": "Consolas" 41 | }, 42 | "indent_guides": { 43 | "coloring": "indent_aware" 44 | }, 45 | "soft_wrap": "editor_width", 46 | "tab_size": 2, 47 | "format_on_save": "on", 48 | "experimental.theme_overrides": { 49 | "syntax": { 50 | "comment": { 51 | "font_family": "Inter", 52 | "font_style": "italic", 53 | "font_weight": 400 54 | } 55 | } 56 | }, 57 | "vertical_scroll_margin": 6, 58 | "restore_on_startup": "none", 59 | "extend_comment_on_newline": false, 60 | "file_types": { 61 | "C++": ["c", "h", "cpp", "hpp"], 62 | "*.mdx": ["markdown"] 63 | }, 64 | "file_scan_exclusions": [ 65 | "**/.git", 66 | "**/.svn", 67 | "**/.hg", 68 | "**/CVS", 69 | "**/.DS_Store", 70 | "**/Thumbs.db", 71 | "**/.classpath", 72 | "**/.settings", 73 | "**/vendor", 74 | "**/.tmp*" 75 | ], 76 | "search.exclude": { 77 | "**/*.snap": true, 78 | "**/.git": true, 79 | "**/.github": false, 80 | "**/.nuxt": true, 81 | "**/.output": true, 82 | "**/.pnpm": true, 83 | "**/.vscode": true, 84 | "**/.yarn": true, 85 | "**/node_modules": true, 86 | "**/out/**": true, 87 | "**/package-lock.json": true, 88 | "**/pnpm-lock.yaml": true, 89 | "**/temp": true, 90 | "**/yarn.lock": true, 91 | "**/CHANGELOG*": true, 92 | "**/LICENSE*": true 93 | }, 94 | "terminal": { 95 | "font_family": "Cascadia Code NF", 96 | "toolbar": { 97 | "title": false 98 | }, 99 | "shell": { 100 | "program": "fish" 101 | }, 102 | "copy_on_select": true 103 | }, 104 | "git": { 105 | "enabled": true, 106 | "autoFetch": true, 107 | "autoFetchInterval": 300, 108 | "autoFetchOnFocus": true, 109 | "autoFetchOnWindowChange": true, 110 | "autoFetchOnBuild": true, 111 | "git_status": true, 112 | "autoFetchOnBuildEvents": ["build", "run", "debug"], 113 | "autoFetchOnBuildEventsDelay": 1500, 114 | "autoFetchOnBuildDelay": 1500, 115 | "git_gutter": "tracked_files", 116 | "inline_blame": { 117 | "enabled": false, 118 | "position": "right" 119 | } 120 | }, 121 | 122 | "languages": { 123 | "C++": { 124 | "formatter": { 125 | "external": { 126 | "command": "clang-format", 127 | "arguments": ["-style=file"] 128 | } 129 | } 130 | }, 131 | "Go": { 132 | "code_actions_on_format": { 133 | "source.organizeImports": true 134 | } 135 | }, 136 | "Rust": { 137 | "tab_size": 4 138 | }, 139 | "Zig": { 140 | "tab_size": 4 141 | }, 142 | "TSX": { 143 | "formatter": { 144 | "external": { 145 | "command": "prettier", 146 | "arguments": ["--stdin-filepath", "{buffer_path}"] 147 | } 148 | }, 149 | "code_actions_on_format": { 150 | "source.organizeImports": true, 151 | "source.fixAll.eslint": true 152 | } 153 | }, 154 | "JavaScript": { 155 | "formatter": { 156 | "external": { 157 | "command": "prettier", 158 | "arguments": ["--stdin-filepath", "{buffer_path}"] 159 | } 160 | }, 161 | "code_actions_on_format": { 162 | "source.fixAll.eslint": true 163 | } 164 | }, 165 | "TypeScript": { 166 | "formatter": { 167 | "external": { 168 | "command": "prettier", 169 | "arguments": ["--stdin-filepath", "{buffer_path}"] 170 | } 171 | }, 172 | "code_actions_on_format": { 173 | "source.organizeImports": true, 174 | "source.fixAll.eslint": true 175 | } 176 | } 177 | }, 178 | 179 | "lsp": { 180 | "rust-analyzer": { 181 | "initialization_options": { 182 | "checkOnSave": { 183 | // rust-analyzer.check.command (default: "check") 184 | // "command": "clippy" 185 | } 186 | } 187 | }, 188 | "eslint": { 189 | "settings": { 190 | "codeActionOnSave": { 191 | "rules": ["import/order"] 192 | } 193 | } 194 | } 195 | }, 196 | 197 | "telemetry": { 198 | "diagnostics": false, 199 | "metrics": false 200 | }, 201 | 202 | "features": { 203 | "edit_prediction_provider": "zed" 204 | } 205 | } 206 | --------------------------------------------------------------------------------