Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Sync KeymappingNew to Visual Studio Code? Get it now.
Sync Keymapping

Sync Keymapping

chenyihui

|
15 installs
| (0) | Free
同步快捷键、MCP、Skills、Agents 配置到各个类VSCode IDE(VSCode、Cursor、Windsurf、Trae)
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Sync Keymapping

An extension for syncing keybindings, MCP, skills, and agents across VS Code-like IDEs.

功能特性

  • 🔄 Sync keybindings, MCP, skills, and agents in one run
  • 🎯 支持 VS Code、Cursor、Windsurf、Trae
  • 💾 自动备份原有配置(带时间戳的备份文件)
  • 📜 保留完整的历史备份记录
  • ⚙️ Configurable target IDEs and resource types
  • 🖥️ 跨平台支持(macOS、Windows、Linux)
  • 🔍 详细的同步结果输出

支持的IDE

  • VS Code - Visual Studio Code
  • Cursor - Cursor Editor
  • Windsurf - Windsurf Editor
  • Trae - Trae Editor

使用方法

1. Sync from current IDE

在命令面板(Cmd+Shift+P 或 Ctrl+Shift+P)中执行:

Sync Keymapping: 从当前IDE同步配置

This syncs all enabled resource types from the current IDE to the other enabled IDEs.

2. Choose source IDE and sync

Sync Keymapping: 选择源IDE并同步配置

这会显示一个选择列表,让你选择要作为源的IDE,然后同步到其他IDE。

3. Sync to all IDEs

Sync Keymapping: 同步配置到所有IDE

Sync enabled resources from the current IDE to all other enabled IDEs.

How To Sync Agents, Skills, And MCP

If your main goal is to sync agents, skills, and MCP from Trae into Cursor, VS Code, or other IDEs, use this workflow.

Scenario 1: Sync from Trae to other IDEs

  1. Make sure these resources exist in Trae:
    • MCP: ~/Library/Application Support/Trae/User/mcp.json
    • Skills: ~/.trae/skills
    • Agents: ~/Library/Application Support/Trae/User/globalStorage/state.vscdb
  2. Enable the resource types you want to sync:
{
  "sync-keymapping.enabledResources": {
    "mcp": true,
    "skills": true,
    "agents": true
  }
}
  1. Enable the target IDEs you want to receive the synced resources:
{
  "sync-keymapping.enabledIDEs": {
    "cursor": true,
    "vscode": true,
    "windsurf": true,
    "trae": true
  }
}
  1. In Trae, run one of these commands from the command palette:
    • 从当前IDE同步配置
    • 同步配置到所有IDE
  2. Verify the output in the target IDEs:
    • MCP is written to the target mcp.json
    • Skills are copied into the target skills directory
    • Agents are exported as markdown files into the target agents directory
  3. Restart the target IDEs so the new configuration is loaded.

Scenario 2: Sync only one resource type

If you only want one resource type, disable the others:

{
  "sync-keymapping.enabledResources": {
    "keybindings": false,
    "mcp": false,
    "skills": true,
    "agents": false
  }
}

Common examples:

  • Sync only skills: keep skills: true
  • Sync only MCP: keep mcp: true
  • Sync only agents: keep agents: true

Resource behavior

  • Keybindings: file-to-file sync, overwrites target keybindings.json
  • MCP: file-to-file sync, overwrites target mcp.json
  • Skills: directory sync, backs up and replaces the whole target directory
  • Agents:
    • Directory-based IDEs such as Cursor use directory sync
    • Trae exports custom agents from state.vscdb into target agent files

Supported agent sync directions

  • Trae to Cursor / VS Code / Windsurf style directory-based agents
  • Cursor to other directory-based IDEs

Unsupported agent sync direction

  • Directory-based agents back into Trae state.vscdb

In practice, the most reliable workflow today is to use Trae as the source IDE and export its agents, skills, and MCP to the other IDEs.

配置选项

启用/禁用IDE同步

在设置中可以配置要同步的目标IDE:

{
  "sync-keymapping.enabledIDEs": {
    "vscode": true,
    "cursor": true,
    "windsurf": true,
    "trae": false
  }
}

将不想同步的IDE设置为 false 即可跳过。

启用/禁用资源类型同步

{
  "sync-keymapping.enabledResources": {
    "keybindings": true,
    "mcp": true,
    "skills": true,
    "agents": true
  }
}

自定义IDE路径

The extension now pre-fills a set of common macOS paths. If your IDE is installed in a different location, or you use a portable setup, you can still change them:

{
  "sync-keymapping.customPaths": {
    "vscode": "",
    "cursor": "/custom/path/to/Cursor/User/keybindings.json",
    "windsurf": "",
    "trae": ""
  }
}

说明:

  • Defaults are prefilled with common macOS user-directory paths
  • 填写完整的绝对路径指向 keybindings.json 文件
  • 支持 ~ 表示用户主目录(macOS/Linux)
  • Windows 路径示例:C:\\Users\\YourName\\CustomPath\\Code\\User\\keybindings.json

自定义 MCP、Skills、Agents 路径

Common macOS paths are prefilled for these resources as well. If your real paths differ, update them explicitly:

{
  "sync-keymapping.customMcpPaths": {
    "vscode": "~/Library/Application Support/Code/User/mcp.json",
    "cursor": "~/.cursor/mcp.json",
    "windsurf": "",
    "trae": "~/Library/Application Support/Trae/User/mcp.json"
  },
  "sync-keymapping.customSkillsPaths": {
    "vscode": "",
    "cursor": "~/.cursor/skills",
    "windsurf": "",
    "trae": "~/.trae/skills"
  },
  "sync-keymapping.customAgentPaths": {
    "vscode": "",
    "cursor": "~/.cursor/agents",
    "windsurf": "",
    "trae": "~/Library/Application Support/Trae/User/globalStorage/state.vscdb"
  }
}
  • customSkillsPaths should point to directories
  • customAgentPaths usually points to directories, but for Trae it points to globalStorage/state.vscdb

快捷键配置文件位置

macOS

  • VS Code: ~/Library/Application Support/Code/User/keybindings.json
  • Cursor: ~/Library/Application Support/Cursor/User/keybindings.json
  • Windsurf: ~/Library/Application Support/Windsurf/User/keybindings.json
  • Trae: ~/Library/Application Support/Trae/User/keybindings.json

Common AI resource paths

  • VS Code MCP: ~/Library/Application Support/Code/User/mcp.json
  • Cursor MCP: ~/.cursor/mcp.json or ~/Library/Application Support/Cursor/User/mcp.json
  • Trae MCP: ~/Library/Application Support/Trae/User/mcp.json
  • Cursor Skills: ~/.cursor/skills
  • Trae Skills: ~/.trae/skills
  • Cursor Agents: ~/.cursor/agents
  • Trae Agents: ~/Library/Application Support/Trae/User/globalStorage/state.vscdb

Trae Agents

Trae stores custom agents in globalStorage/state.vscdb instead of a user-facing agents directory. The extension reads the ItemTable entries such as currentAgentData_*, previousAgentData_*, and localAgentData_*, extracts custom agents, and exports them as markdown agent files for target IDEs.

Supported today:

  • Trae agents to directory-based agents in other IDEs

Not supported today:

  • Directory-based agents back into Trae state.vscdb

Windows

  • VS Code: %APPDATA%\Code\User\keybindings.json
  • Cursor: %APPDATA%\Cursor\User\keybindings.json
  • Windsurf: %APPDATA%\Windsurf\User\keybindings.json
  • Trae: %APPDATA%\Trae\User\keybindings.json

Linux

  • VS Code: ~/.config/Code/User/keybindings.json
  • Cursor: ~/.config/Cursor/User/keybindings.json
  • Windsurf: ~/.config/Windsurf/User/keybindings.json
  • Trae: ~/.config/Trae/User/keybindings.json

安全性

自动备份机制

每次同步前,扩展会自动备份目标IDE的原有配置:

  • 文件型资源备份格式:xxx.backup.YYYY-MM-DDTHH-MM-SS
  • 目录型资源备份格式:folder.backup.YYYY-MM-DDTHH-MM-SS
  • 示例:keybindings.json.backup.2026-02-09T11-18-23
  • 保留策略:每次同步创建新备份,不会覆盖旧备份
  • 恢复方法:手动将备份文件重命名为 keybindings.json 即可恢复

备份文件位置

备份文件与原配置文件在同一目录下:

  • macOS: ~/Library/Application Support/{IDE}/User/
  • Windows: %APPDATA%\{IDE}\User\
  • Linux: ~/.config/{IDE}/User/

清理建议

随着时间推移,备份文件会逐渐积累。建议定期清理旧的备份文件以节省空间。

注意事项

  • Sync overwrites the same resource on the target IDE, but creates a backup first
  • Directory resources are mirrored as a whole, so skills and agents are replaced directory by directory
  • Trae agent sync is database-backed, so the target agents directory is regenerated from the extracted custom agents
  • Some IDEs do not expose a stable default path for all AI resources; use custom paths when auto-detection is not enough

开发

安装依赖

npm install

编译

npm run compile

监听模式

npm run watch

调试

按 F5 在扩展开发主机中启动扩展。

打包

npm install -g @vscode/vsce
vsce package

许可证

MIT

贡献

欢迎提交 Issue 和 Pull Request!

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft