vscode 配置格式化代码

VSCode  docs

1. ctrl+shift+p ,输入setting ,选择 preferences:open settings(json)

vscode配置 yapf ,格式化代码, 添加自动补全

{
     // 设置Python的路径,
     "python.pythonPath": "D:\\program\\install\\pycharm\\Anconda2\\envs\\python3\\python.exe",
     // 设置Python的代码格式化
    "python.formatting.provider": "yapf",   
    // 设置Python的代码检查
    "python.linting.flake8Path": "pycodestyle",
    "python.linting.flake8Enabled": true,
  // 自动补全
    "python.autoComplete.extraPaths": [
            "D:/program/install/pycharm/Anconda2/envs/python3/",
            "D:/program/install/pycharm/Anconda2/envs/python3/Lib",
            "D:/program/install/pycharm/Anconda2/envs/python3/Lib/site-packages/",
            "D:/program/install/pycharm/Anconda2/envs/python3/DLLs/"
        ],
     "python.autoComplete.addBrackets": true,
    "workbench.editorAssociations": {
        "*.ipynb": "jupyter.notebook.ipynb"
    },
    "files.insertFinalNewline": true,
    "files.autoSave": "afterDelay",
    "editor.formatOnSave": true,
    "python.formatting.yapfArgs": [
        "--style={based_on_style: pep8, indent_width: 4}"
    ],
    "editor.detectIndentation": false,
    "editor.fontSize": 18,
    "[python]": {


        "editor.wordBasedSuggestions": false
    },
    "python.analysis.extraPaths": [
        "D:/program/install/pycharm/Anconda2/envs/python3/",
        "D:/program/install/pycharm/Anconda2/envs/python3/Lib",
        "D:/program/install/pycharm/Anconda2/envs/python3/Lib/site-packages/",
        "D:/program/install/pycharm/Anconda2/envs/python3/DLLs/"
    ],
    "python.analysis.completeFunctionParens": true,
}
 

 

posted @ 2021-06-11 09:04  绵绵01  阅读(1043)  评论(0编辑  收藏  举报
levels of contents