VScode python基本设置
工作区settings.json
{
"python.testing.unittestArgs": [
"-v",
"-s",
"./__pycache__",
"-p",
"*test.py"
],
"python.testing.pytestEnabled": false,
"python.testing.nosetestsEnabled": false,
"python.testing.unittestEnabled": true,
"editor.wordWrap": "on", // 自动换行
"editor.lineHeight": 26, // 编辑器中的行高
"editor.fontSize": 16, // 编辑器中的字体大小
"editor.formatOnSave": true, //编辑器自动保存
"python.linting.flake8Enabled": true, //启用flake8,首先需要pip3 install falke8
"python.formatting.provider": "yapf", ///启用yapf,首先需要pip3 install yapf
"workbench.iconTheme": "vscode-icons", //启用vscode图标
"python.pythonPath": "/home/xxx/anaconda3/envs/dev/bin/python"
}
用户settings.json
{
"workbench.iconTheme": "vscode-icons",
"editor.fontFamily": "'JetBrains Mono', 'Courier New', monospace",
"files.autoSave": "afterDelay",
"html.hover.documentation": false,
"html.hover.references": false,
"workbench.colorTheme": "Atom One Dark",
"vsicons.dontShowNewVersionMessage": true,
"bracketPairColorizer.depreciation-notice": false,
"leetcode.endpoint": "leetcode-cn",
"leetcode.workspaceFolder": "e:\\leetcode_data",
"leetcode.hint.configWebviewMarkdown": false,
"leetcode.hint.commentDescription": false,
"leetcode.defaultLanguage": "python3"
}
JetBrains Mono字体下载
下载后,全选右键安装即可
推荐插件
Python(Python必装)
Path Intellisense(自动联想路径)
vscode-icons(文件图标)
Bracket Pair Colorizer(用不同颜色区分出代码中的括号)
Chinese (Simplified) (简体中文)
Atom One Dark Theme(非常不错的暗色调主题)