You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 24.04下Visual Studio Code手动配置快捷键的存储位置及恢复方法

VS Code快捷键配置存储位置与CLI恢复方法

配置文件存储路径

VS Code的自定义快捷键配置保存在keybindings.json文件中,不同系统的具体路径如下:

  • Windows:%APPDATA%\Code\User\keybindings.json
  • macOS:$HOME/Library/Application Support/Code/User/keybindings.json
  • Linux:$HOME/.config/Code/User/keybindings.json

通过CLI在新系统恢复配置

  1. 先将你的keybindings.json纳入dotfiles仓库管理,确保文件已同步到仓库中。
  2. 在新系统完成VS Code安装后,执行对应系统的CLI命令,将仓库中的配置文件复制到VS Code的用户配置目录:
    • Windows(PowerShell):
      Copy-Item -Path "你的dotfiles仓库中keybindings.json的路径" -Destination "$env:APPDATA\Code\User\keybindings.json" -Force
      
    • macOS(Bash/Zsh):
      cp 你的dotfiles仓库中keybindings.json的路径 ~/Library/Application\ Support/Code/User/keybindings.json
      
    • Linux(Bash/Zsh):
      cp 你的dotfiles仓库中keybindings.json的路径 ~/.config/Code/User/keybindings.json
      
  3. 重启VS Code,自定义快捷键配置即可生效。

内容的提问来源于stack exchange,提问作者reducing activity

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.14 00:02:02