随着持续的版本演进,VS Code 的功能也越来越多,其中一个比较好用的功能是 VS Code 配置(VS Code Profiles)。
Visual Studio Code有数百种设置、数千种扩展和无数种调整UI布局的方法来自定义编辑器。VS Code Profiles允许您创建自定义设置,并在它们之间快速切换或与他人共享。
VS Code 配置总体上使用比较简单,可以参考官方文档。
基于 VS Code 提供的 Python 配置模板,我进行了一些修改。
我本身喜欢浅色主题,一直在用 bluloco light
图标主题选择的是最受欢迎的 vscode-icons。
Git Lens的功能有些过于臃肿,暂时不加入插件列表。
{
"python.analysis.autoImportCompletions": true,
"python.analysis.fixAll": ["source.unusedImports"],
"editor.defaultFormatter": "ms-python.black-formatter",
"files.exclude": {
"**/__pycache__": true,
"**/.cache": true,
"**/.coverage": true,
"**/.coverage.*": true,
"**/.hypothesis": true,
"**/.mypy_cache": true,
"**/.nox": true,
"**/.pytest_cache": true,
"**/.ruff_cache": true,
"**/.tox": true
},
"workbench.colorTheme": "Bluloco Light Italic",
"workbench.iconTheme": "vscode-icons",
"editor.fontFamily": "'FiraCode NFM Retina', Consolas, 'Courier New', monospace",
"editor.fontSize": 24,
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "modificationsIfAvailable",
"editor.acceptSuggestionOnEnter": "smart",
"merge-conflict.autoNavigateNextConflict.enabled": true,
"gitblame.inlineMessageEnabled": true
}