我的 VSCode 配置

Python 程序员应该首要使用免费的 VSCode [1] 编辑器.

#VSCode

我的开发主要语言 Python, 偶尔写一些页面, 包括 Vue.js 和 jQuery 页面.

以下为通用设置

{
    "files.exclude": {
        "**/.git": true,
        "**/.svn": true,
        "**/.hg": true,
        "**/*.pyc": true,
        "**/.DS_Store": true,
        "**/__pycache__": true,
        "**/node_modules": true,
    },
    "window.zoomLevel": 1,
    "editor.letterSpacing": 0.5,
    "workbench.activityBar.visible": true,
    "workbench.colorTheme": "Solarized Dark",
    "editor.tabSize": 2,
    // Python
    "python.venvPath": "~/.virtualenvs",
    "python.linting.enabled": true,
    "python.linting.pylintEnabled": true,
    "python.linting.pep8Enabled": false,
    "python.analysis.logLevel": "Warning",
    "python.dataScience.sendSelectionToInteractiveWindow": true,
    // Python
    "[python]": {
        "editor.rulers": [
            72,
            79
        ],
        "editor.tabSize": 4,
        "editor.insertSpaces": true
    },
    // JS
    "[javascript]": {
        "editor.tabSize": 2
    },
    "html.format.enable": false,
}
<\>Js

除了以上的通用设置, 我还会在每个项目中定义虚拟环境位置。 在项目的目录下在 .vscode/settings.json

一般通过 Python: Select Interpreter 选择虚拟环境解析器自动创建, 其他的关于此项目的配置也都在这个文件, 但通用环境的配置够用,一般也没有其他的配置.

{
    "python.pythonPath": "/path/to/virtualenv/bin/python"
}
<\>Json

引用