Communitygithub.com

G1Joshi/Agent-Skills

专业的 Zed 编辑器辅助技能,涵盖高性能 Rust 文本编辑、多缓冲区编辑、语言服务器协议 (LSP) 以及 AI 助手集成。用于配置 Zed 的 settings.json、设置语言扩展、实时协作或优化编辑器启动速度。

Agent-Skills 是什么?

此技能为开发者或 AI 代理用户提供全面的 Zed 编辑器高级配置与使用指导。它详细介绍了如何利用 Zed 的高性能特性(基于 Rust 引擎的亚毫秒级延迟和 GPU 加速 UI)进行高效代码编辑,并支持实时多人协同编程(音频聊天、共享光标)和 AI 助手(如 Claude、Zeta)的本地集成。技能涵盖了核心配置文件(如 settings.json 和 keymap.json)的优化设置,包括主题、字体、LSP 语言服务器(rust-analyzer、vtsls、pyright 等)和格式化工具(Prettier、Ruff)的配置。同时提供了多缓冲区搜索与替换、自定义语言服务器等常见问题的实用模式与最佳实践(2026 年更新)。技能支持在多种语境下使用,包括日常编辑、团队协作和配置调试。

兼容平台✓Claude Code✓Codex CLI✓Cursor
npx skills add https://github.com/G1Joshi/Agent-Skills/tree/HEAD/skills/tools/zed

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Zed

Zed 是一款由 Atom 创建者打造的高性能编辑器。它基于 Rust 构建,并采用 GPU 加速的 UI。2025 年带来了 Zeta(开放模型 AI)和 ACP(代理客户端协议)。

何时使用

  • 高性能 Rust 引擎代码编辑:亚毫秒级输入延迟、即时文件打开以及流畅的 120 FPS 渲染。
  • 实时多人结对编程:直接在编辑器缓冲区中协作,支持音频聊天和共享光标会话。
  • 集成语言模型 (LLM) 助手:原生生成代码、重构函数以及查询代码库上下文。
  • 现代 Tree-sitter 和 LSP 多语言开发:开箱即用地无缝支持 Rust、TypeScript、Python 和 Go。

快速入门

1. 最小化 ~/.config/zed/settings.json 配置

{
  "theme": "One Dark",
  "buffer_font_family": "JetBrains Mono",
  "buffer_font_size": 14,
  "tab_size": 2,
  "hard_tabs": false,
  "format_on_save": "on",
  "formatter": "auto",
  "lsp": {
    "rust-analyzer": {
      "initialization_options": {
        "checkOnSave": { "command": "clippy" }
      }
    }
  }
}

2. 核心快捷键

  • Cmd + P:文件查找器
  • Cmd + Shift + P:命令面板
  • Cmd + Shift + F:项目搜索
  • Cmd + ?:切换 AI 助手面板

核心概念

生产环境 Zed 配置(~/.config/zed/settings.json)

配置排版、格式化工具、LSP 语言服务器以及 AI 集成:

{
  "theme": "One Dark",
  "ui_font_size": 15,
  "buffer_font_size": 14,
  "buffer_font_family": "JetBrains Mono",
  "autosave": "on_focus_change",
  "format_on_save": "on",
  "tab_size": 2,
  "telemetry": {
    "diagnostics": false,
    "metrics": false
  },
  "languages": {
    "TypeScript": {
      "language_servers": ["vtsls", "!typescript-language-server"],
      "formatter": {
        "external": {
          "command": "prettier",
          "arguments": ["--stdin-filepath", "{buffer_path}"]
        }
      }
    },
    "Rust": {
      "language_servers": ["rust-analyzer"]
    },
    "Python": {
      "language_servers": ["pyright", "ruff"]
    }
  },
  "assistant": {
    "default_model": {
      "provider": "anthropic",
      "model": "claude-3-5-sonnet"
    }
  }
}

自定义模态与 Vim 键位绑定(~/.config/zed/keymap.json)

为高速导航自定义键位映射:

[
  {
    "context": "Editor && vim_mode == normal",
    "bindings": {
      "space f f": "file_finder::Toggle",
      "space f g": "pane::DeploySearch",
      "space b d": "pane::CloseActiveItem",
      "space c a": "editor::ToggleCodeActions",
      "g d": "editor::GoToDefinition",
      "g r": "editor::FindAllReferences"
    }
  }
]

即时多人协作

  • 点击右上角窗口标题栏中的协作图标。
  • 分享您的房间链接或通过 GitHub 用户名邀请团队成员。
  • 团队成员可共享编辑器视图、跟随光标,并同时编辑代码,无屏幕共享延迟。

常见模式

多缓冲区项目搜索与替换

问题:在整个代码库中搜索,并在单个统一缓冲区中同时编辑所有结果。 解决方案:打开多缓冲区编辑器。

  1. 按下 Cmd + Shift + F 打开项目搜索。
  2. 输入搜索词并按 Enter。
  3. 按下 Option + Enter 将所有匹配项展开为可编辑的多缓冲区。
  4. 跨多个文件原地进行代码编辑,然后保存(Cmd + S)以写入所有文件。

在 Zed 中配置自定义语言服务器

问题:在 Zed 中配置特定的语言服务器参数和格式化工具。 解决方案:在 settings.json 中定义服务器设置。

{
  "languages": {
    "Python": {
      "language_servers": ["pyright", "ruff"],
      "format_on_save": "on",
      "formatter": {
        "external": {
          "command": "ruff",
          "arguments": ["format", "--stdin-filename", "{buffer_path}"]
        }
      }
    }
  }
}

最佳实践(2026 年)

  • 应 使用外部工具(Prettier、Ruff、Rustfmt)配置 format_on_save: "on" 以实现自动代码整洁。
  • 应 在 Zed 中使用 vtsls 进行 TypeScript 开发,以获得更优的性能和内存效率。
  • 应 如果习惯模态编辑工作流,请启用 Vim 模式("vim_mode": true)。
  • 应 利用原生助手面板(Cmd + ?)结合代码库上下文进行快速重构。
  • 不应 在项目文件夹中包含未排除的构建缓存(target、dist、.next)。
  • 不应 在 settings.json 中硬编码私有 API 密钥;应使用系统钥匙串或环境变量。
  • 不应 在编辑敏感生产配置文件时,将协作房间保持打开和公开状态。

故障排除

错误/症状原因解决方案
语言服务器无法初始化服务器二进制文件(例如 gopls、pyright)未在系统 $PATH 中找到全局安装服务器二进制文件,或确保其在用户 shell 环境中可访问。
键位绑定与系统快捷键冲突Mac 系统键盘快捷键截获了 Zed 的按键操作检查 ~/.config/zed/keymap.json 中的 settings.json 键位映射覆盖。
Zed AI 助手无法响应缺少 API 密钥(OpenAI/Anthropic)或配额已超限打开 Zed 设置,配置 "features": { "edit_prediction_provider": "copilot" } 或提供 API 密钥。

参考

Individual skills in this repo

This repo contains 11 individual skills — each has its own dedicated page.

G1Joshi/Agent-Skills

Expert Dask distributed computing assistance covering Dask DataFrames, Arrays, Futures, and cluster scaling. Use when analyzing datasets too large for pandas on a single machine or multi-node cluster.

G1Joshi/Agent-Skills

Expert dbt (data build tool) assistance covering SQL modeling, Jinja macros, tests, documentation, and semantic layer. Use when building analytics engineering pipelines on BigQuery, Snowflake, or PostgreSQL.

G1Joshi/Agent-Skills

Expert JAX assistance covering Autograd, XLA compilation (`jit`), vectorization (`vmap`), and parallelization (`pmap`). Use when building high-performance numerical computing and cutting-edge deep learning research.

G1Joshi/Agent-Skills

Expert Ray distributed computing assistance covering Ray Core (actors, tasks), Ray Train, Ray Tune, and Ray Serve. Use when scaling Python compute and ML training across multi-node clusters.

G1Joshi/Agent-Skills

Expert Git version control assistance covering branching, interactive rebase, cherry-pick, submodules, worktrees, and conflict resolution. Use when managing source code history and collaboration workflows.

G1Joshi/Agent-Skills

Expert K9s CLI assistance covering terminal Kubernetes cluster navigation, real-time log streaming, port forwarding, and pod debugging. Use when managing and troubleshooting Kubernetes clusters with speed.

G1Joshi/Agent-Skills

Expert SWC assistance covering high-performance Rust-based JavaScript/TypeScript compilation, .swcrc configuration, Jest testing via @swc/jest, and minification. Use when replacing Babel with SWC for faster builds, accelerating test execution, or compiling modern ECMAScript features.

G1Joshi/Agent-Skills

Expert Tig assistance covering text-mode interface for Git, interactive staging, commit graph visualization, diff exploration, and blame navigation. Use when navigating Git commit history in the terminal, staging hunks interactively, browsing file changes, or reviewing revisions.

G1Joshi/Agent-Skills

Expert Vim assistance covering modal editing, .vimrc configuration, registers, macros, search/replace, and plugin management via vim-plug. Use when editing text efficiently in terminal environments, writing Vimscript, recording macros, or configuring core Vim settings.

G1Joshi/Agent-Skills

Expert Zsh assistance covering shell customization, Oh My Zsh plugins, Zinit plugin manager, prompt engineering (Starship/Powerlevel10k), and shell scripting. Use when configuring .zshrc, writing Zsh automation scripts, optimizing shell startup time, or configuring tab-completion.

G1Joshi/Agent-Skills

Expert [skill-name] assistance covering [feature 1], [feature 2], and [feature 3]. Use when [working with X], [debugging Y], or [implementing Z].

相关技能