跳到主要内容

一份珍藏多年的 VSCode 配置

小林
后端开发工程师, 专注Go开发、微服务和云原生

记录下最符合个人习惯的 VSCode 配置, 只修改非默认项以保持配置文件的简洁. 可能会随着使用不断补充更新.

hero-poster-dark

Settings

settings.json
{
"window.newWindowProfile": "Default", // 新窗口使用的配置文件, 只能在"默认配置文件"中设置
"files.autoSave": "afterDelay", // 自动保存文件
"editor.formatOnSave": true, // 保存时自动格式化
"files.simpleDialog.enable": true, // 简单对话框, ctrl+n 新建文件时不再弹出对话框
"editor.insertSpaces": true, // 使用空格代替制表符
"editor.tabSize": 4, // 缩进空格数
"editor.autoClosingDelete": "always", // 删除左括号时总是自动删除右括号
"editor.minimap.autohide": "mouseover", // 鼠标不在缩略图上时隐藏缩略图,鼠标在缩略图上时显示缩略图
"terminal.integrated.cursorStyle": "underline", // 终端光标样式使用下划线
"explorer.confirmDelete": false, // 删除文件时不再弹出确认对话框
"explorer.confirmDragAndDrop": false, // 拖放移动文件或文件夹时不再弹出确认对话框
"vsicons.dontShowNewVersionMessage": true, // 不显示新版本消息
"workbench.iconTheme": "vscode-icons", // 使用 vscode-icons 图标主题
}

键盘快捷键

keybindings.json
[
{
"key": "ctrl+k ctrl+u",
"command": "editor.action.transformToUppercase" // 转为大写
},
{
"key": "ctrl+k ctrl+l",
"command": "editor.action.transformToLowercase" // 转为小写
}
]

插件

extensions.json
{
"recommendations": [
"piotrpalarz.vscode-gitignore-generator", // .gitignore 文件生成器
"mhutchie.git-graph", // Git 图形化视图
"eamodio.gitlens", // Git 增强工具, 主要为了能显示代码作者
"golang.go", // Go 语言支持
"ritwickdey.liveserver", // HTML 实时预览
"ms-python.vscode-pylance", // Python 语言支持
"mushan.vscode-paste-image", // 支持粘贴图片到 Markdown
"vscode-icons-team.vscode-icons", // VSCode 图标主题
"github.copilot", // GitHub Copilot, AI 代码补全
"github.copilot-chat" // GitHub Copilot Chat, AI 聊天助手
]
}