目錄
1. 問題:
最近一直在用VSCode 寫代碼,發現網上對這個settings.json 文件解釋配置項褒貶不一,各個地方都是粘貼複製一點的;現在簡單彙總一下後續持續更新中;
2. 配置:
自定義配置項:
{
"python.pythonPath": "venv2/bin/python",
"python.formatting.provider": "yapf",
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.linting.flake8Args": ["--max-line-length=250"],
"editor.formatOnSave": true,
"editor.tabSize": 4,
"editor.detectIndentation": false,
"debug.toolBarLocation": "docked",
// "terminal.integrated.copyOnSelection": true,
"workbench.editor.enablePreview": false,
"workbench.editor.enablePreviewFromQuickOpen": false,
"files.insertFinalNewline": true,
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/*.pyc": true
},
}
用戶工作空間配置項(設置 -> 用戶 -> 常用設置 -> Files: Associations 在settings.json 中編輯):
{
"editor.fontSize": 24,
"git.autofetch": true,
"editor.wordWrapColumn": 120,
"workbench.iconTheme": "vscode-icons",
"files.exclude": {
"**/.classpath": true,
"**/.factorypath": true,
"**/.project": true,
"**/.pyc": true,
"**/.settings": true
},
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"editor.renderWhitespace": "all",
"[jsonc]": {
"editor.defaultFormatter": "HookyQR.beautify"
},
"files.autoGuessEncoding": true,
"[python]": {},
"terminal.integrated.fontSize": 14,
"debug.console.fontSize": 14,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"[json]": {
"editor.defaultFormatter": "HookyQR.beautify"
},
"scm.defaultViewMode": "tree",
"scm.alwaysShowActions": true,
"editor.renderControlCharacters": true,
"editor.renderIndentGuides": false,
"files.autoSave": "afterDelay",
"workbench.sideBar.location": "left",
"breadcrumbs.symbolSortOrder": "type",
"window.zoomLevel": 1,
"python.jediMemoryLimit": 1024,
"python.jediEnabled": false,
// "terminal.integrated.shell.osx": "/usr/local/bin/fish",
// "terminal.integrated.automationShell.osx": "/bin/sh"
}
3. 參考:
- User and Workspace Settings;
- Editing JSON with Visual Studio Code;
- Python settings reference;
- VS Code 有哪些必不可少的設置項?
- Visual Studio Code
- 通過配置 VS Code 來提高生產力;
(完)