VScode打造Python开发环境

友情提醒:本文最后更新于 610 天前,文中所描述的信息可能已发生改变,请谨慎使用。

前言

VScode是一个相当优秀的IDE,具备开源、跨平台、模块化、插件丰富、启动时间快、颜值高、可高度定制等等优秀的特质。所以用VScode来编写Python,或者是做全栈开发,也是相当的好用的。所以,今天我们记录一下VScode中常用的插件和配置。

插件推荐

  1. Python插件。微软官方为 vscode 开发了python插件,这里安装这个插件就会提供全面的 python IDE 的功能了。
  2. Chinese(Simplified)Language。中文简体语言包。
  3. Auto Close Tag。自动添加HTML / XML关闭标签。
  4. Auto Rename Tag。自动重命名配对的HTML / XML标签。
  5. GitLens — Git supercharged。显示文件最近的 commit 和作者,显示当前行 commit 信息。
  6. Path Intellisense。路径自动补全。
  7. Vetur。Vue 语法高亮显示, 语法错误检查, 代码自动补全(配合 ESLint 插件效果更佳)。
  8. One Dark Pro。一个主题插件。
  9. Bracket Pair Colorizer。给括号加上不同的颜色,便于区分不同的区块,使用者可以定义不同括号类型和不同颜色。
  10. vscode-icons。图标主题。
  11. Power Mode。一个可以让写代码变得有意思的插件,写代码时可以窜出小火苗。
  12. Highlight Matching Tag。高亮显示匹配的标签。
  13. Sublime Text Keymap and Settings Importer。如果你曾经使用sublime text编写代码,那这个插件可以让你继续使用sublime的快捷键。
  14. TabNine。程序员杀手级代码提示插件。

配置文件

# 将设置放入此文件中以覆盖默认设置
{
    "editor.fontSize": 13,
    // "editor.fontFamily": "Source Code Pro",
    "editor.fontFamily": "Fira Code SemiBold",
    "editor.fontLigatures": true,
    // "editor.fontWeight": "bold",
    "editor.lineHeight": 25,
    "files.exclude": {
        "**/.git": true,
        "**/.svn": true,
        "**/.hg": true,
        "**/CVS": true,
        "**/.DS_Store": true,
        "**/*.pyc": true,
        "**/.idea": true,
        "**/.vscode": true,
        "**/__pycache__": true,
        "**/.mypy_cache": true,
    },
    "files.trimTrailingWhitespace": true,
    "files.insertFinalNewline": true,
    "files.trimFinalNewlines": true,
    "files.autoSave": "onFocusChange",
    "window.openFilesInNewWindow": "on",
    "editor.rulers": [
        140
    ],
    "workbench.startupEditor": "welcomePage",
    "explorer.confirmDragAndDrop": false,
    "explorer.autoReveal": false,
    "editor.quickSuggestions": {
        "other": true,
        "comments": true,
        "strings": true
    },
    "javascript.validate.enable": false,
    "typescript.validate.enable": false,
    "workbench.activityBar.visible": true,
    "workbench.editor.enablePreview": false,
    "emmet.syntaxProfiles": {
        "vue-html": "html",
        "vue": "html"
    },
    "breadcrumbs.enabled": true,
    "workbench.iconTheme": "vscode-icons",
    "search.exclude": {
        "logs/**": true
    },
    "workbench.colorTheme": "One Dark Pro Flat",
    "search.showLineNumbers": true,
    "search.smartCase": true,
    "search.useIgnoreFiles": false,
    "python.linting.enabled": true,
    "python.formatting.provider": "black",
    "window.zoomLevel": 0,
    "explorer.confirmDelete": false,
    "python.analysis.diagnosticSeverityOverrides": {
        "reportMissingImports": "none",
        "reportMissingModuleSource":"none"
    },
    "editor.unicodeHighlight.invisibleCharacters": false,
    "json.maxItemsComputed": 500000,
    "python.linting.flake8Enabled": true,
    "python.linting.flake8Args": [
        "--ignore=E701,E266,E309,E306,E501,C901,C0301,W0142,W0401,W0402,R0201,E1101,E1102,C0103,R0901,R0903,R0904,C1001,W0223,W0232,W0201,E1103,R0801,C0111,E722,W292,E402,F821,W503,E203"
    ],
    "python.formatting.blackArgs": [
        "--skip-string-normalization"
    ],
    "editor.unicodeHighlight.ambiguousCharacters": false,
    "editor.unicodeHighlight.includeComments": false,
    "editor.inlineSuggest.enabled": true,
    "tabnine.experimentalAutoImports": true,
    "python.analysis.autoImportCompletions": false,
    "settingsSync.ignoredSettings": [

    ],
    "editor.codeActionsOnSave": {
    }
}
# pep8 pylama或pylint需要pip安装使用

上一篇:Python的赋值、浅拷贝和深拷贝解析

下一篇:Sublime Text 3打造Python开发环境