折腾了好久,零零散散装了40个插件,包括Python,HTML和C/C++,远程、xml、Markdown、注释的配置项 有些我也不知道是干啥用的(我可以不用但是一定要有 哈哈)基本上算是配置好了,留个记录。

顺便说一句kite pro从6月4号开始免费了,所以这个插件还是挺香的。https://help.kite.com/article/148-kite-pro-availability

mac vs code怎么运行python mac配置vscode python_经验分享

插件全家福:

mac vs code怎么运行python mac配置vscode python_编辑器_02


mac vs code怎么运行python mac配置vscode python_python_03


mac vs code怎么运行python mac配置vscode python_vscode_04


mac vs code怎么运行python mac配置vscode python_编辑器_05

配置:
{
    // ------------------ editor style ------------------
    // 控制树缩进(以像素为单位)。
    "workbench.tree.indent": 20,
    // 配置语言的文件关联 (如: "*.extension": "html")。这些关联的优先级高于已安装语言的默认关联。
    "files.associations": {
        // "*.html": "html",
        // "*.vue": "html",
        // "*.css": "html"
    },
    // 光标上下移动时,上下边界显示的最小行数
    "editor.cursorSurroundingLines": 3,
    // 平滑插入动画
    "editor.cursorSmoothCaretAnimation": false,
    // json解析最大数量
    "json.maxItemsComputed": 50000,
    // 控制资源管理器是否在把文件删除到废纸篓时进行确认
    "explorer.confirmDelete": true,
    // 将使用数据发送到官方
    "telemetry.enableTelemetry": false,
    // 终端缓冲区大小
    "terminal.integrated.scrollback": 999999,
    // 控制终端选项卡的位置,该位置位于实际终端的左侧或右侧
    "terminal.integrated.tabs.location": "left",
    // 离开扩展视图时,关闭扩展详情页
    "extensions.closeExtensionDetailsOnViewChange": true,
    // 终端保存最近命令条数
    "workbench.commandPalette.history": 2000,
    // 控制编辑器是否已启用链接编辑。相关符号(如 HTML 标记)在编辑时进行更新,具体由语言而定。
    "editor.linkedEditing": true,
    // 字体
    "editor.fontSize": 16,
    // 打开文件时自动定位到目录
    "explorer.autoReveal": false,
    // 按tab时插入空格
    "editor.insertSpaces": true,
    // 1个tab=4个空格
    "editor.tabSize": 4,
    // 由于性能原因,超过这个长度的行将不会被标记
    "editor.maxTokenizationLineLength": 9999,
    // 双击选中文字时的切割标志
    "editor.wordSeparators": "`~!@#$%^&*()=+[{]}\\|;:'\",.<>/?。,",
    // 自动打开上次关闭窗口
    "window.restoreWindows": "none",
    // 编辑器中显示 CodeLens。
    "diffEditor.codeLens": true,
    // 重启内核之前警告
    "jupyter.askForKernelRestart": true,
    // 允许将使用数据和错误发送到Red Hat服务器
    "redhat.telemetry.enabled": false,

    // ------------------ editor config ------------------
    // 文件图标主题
    "workbench.iconTheme": "material-icon-theme",
    // windows中使用的终端类型
    "terminal.integrated.defaultProfile.windows": "Command Prompt",
    // "terminal.integrated.automationShell.windows": "PowerShell",
    // 智能感知(补全)
    "vsintellicode.modify.editor.suggestSelection": "choseToUpdateConfiguration",
    // 控制在建议列表中如何预先选择建议。
    // recentlyUsed: 根据输入的前缀匹配
    // recentlyUsedByPrefix:根据之前补全过的建议的前缀来进行选
    "editor.suggestSelection": "recentlyUsedByPrefix",
    // 控制排序时是否首选光标附近的字词。
    "editor.suggest.localityBonus": true,
    // 控制 SCM 视图在打开文件时是否应自动显示和选择文件。不自动打开目录
    "scm.autoReveal": true,
    // 控制是否根据文档中的文字计算自动完成列表。
    "editor.wordBasedSuggestions": false,
    // 对大型文件进行特殊处理,禁用某些内存密集型功能。
    "editor.largeFileOptimizations": true,
    // 打开文件时,基于文件内容自动检测
    "editor.detectIndentation": false,
    // 控制编辑器在键入一行后是否自动格式化该行。
    "editor.formatOnType": true,

    // 全局共享提示
    "editor.suggest.shareSuggestSelections": true,
    // 在输入时显示含有参数文档和类型信息的小面板。
    "editor.parameterHints.enabled": true,


    // 编辑器是否在左括号后自动插入右括号。
    "editor.autoClosingBrackets": "beforeWhitespace",
    // 在删除时编辑器是否应删除相邻的右引号或右方括号。
    "editor.autoClosingDelete": "auto",

    // 打开的编辑器是否显示为预览
    "workbench.editor.enablePreview": true,
    // 文件保存方式:当编辑器失去焦点
    "files.autoSave": "onFocusChange",
    // 保存文件时删除多余空行
    "files.trimFinalNewlines": true,
    // 保存文件时尾插一行
    "files.insertFinalNewline": true,
        
    // 自动更新已启用的插件
    "extensions.autoUpdate": "onlyEnabledExtensions",
    // 自动提示
    "editor.quickSuggestions": {
        "other": true,
        "comments": true,
        "strings": true
    },
    // 将 glob 模式配置到编辑器,优先顺序高于默认行为。
    "workbench.editorAssociations": {
        "*.ipynb": "jupyter-notebook"
    },

    // 应在何处显示单元格工具栏,或是否隐藏它。
    "notebook.cellToolbarLocation": {
        "default": "right",
        "jupyter-notebook": "left"
    },
    // 在保存时运行的代码操作类型。
    "editor.codeActionsOnSave": {
        // 保存文件时自动整理import
        "source.organizeImports": false,
    },

    // 全文本搜索和快速打开中排除文件和文件夹。从“#files.exclude#”设置继承所有glob模式
    "search.exclude": {
        "**/.venv": true
    },
    // 加载文件或目录时忽略的文件,从全局files.exclude中继承
    "files.exclude": {
        "**/__pycache__": true,
        "**/*.pyc": true
    },

    // ------------------ debug  ------------------
    // 调试工具栏一直显示
    "debug.showInStatusBar": "always",
    // 任何文件中打断点
    "debug.allowBreakpointsEverywhere": true,
    // 断点显示在概览标尺中
    "debug.showBreakpointsInOverviewRuler": true,
    // 控制调试子会话是否显示在调试工具栏中。当此设置为 false 时, 子会话上的stop命令也将停止父会话。
    "debug.showSubSessionsInToolBar": true,
    // 调试工具栏停靠在调试视图中,而不是浮动显示
    "debug.toolBarLocation": "docked",
    // 全局调试启动配置。应当作为跨工作区共享的 \"launch.json\" 的替代方法
    "launch": {
        // 只看自己的代码
        "justMyCode": true,
        // "cwd": "${workspaceFolder}/python",
        // "env": {
        //     "PYTHONPATH": "${workspaceFolder}/python"
        // },
    },

    // ------------------ remote  ------------------
    // 同一个远程地址打开多个窗口不需要重复输入密码
    "remote.SSH.useLocalServer": true,
    // 根据host指定远程服务器类型:macOS,linux,windows
    "remote.SSH.remotePlatform": {
        "119.3.141.240": "linux",
    },

    // ------------------ 合并冲突  ------------------
    // 解决合并冲突后跳转下一冲突
    "merge-conflict.autoNavigateNextConflict.enabled": true,

    // ------------------ html css js xml ------------------
    // 以建议的形式显示展开的 Emmet 缩写
    "emmet.showExpandedAbbreviation": "inMarkupAndStylesheetFilesOnly",
    // 将可能的 Emmet 缩写作为建议进行显示。
    // 当在样式表中或 emmet.showExpandedAbbreviation 设置为 "never" 时不适用。
    "emmet.showAbbreviationSuggestions": true,
    // 规范元素内内容的空白。删除换行符和多余的空白。
    "xml.format.joinContentLines": true,

    // 在编辑器中单击开始标记时,启用XML Document视图中的元素的自动显示。
    "xmlTools.enableXmlTreeViewCursorSync": true,
    // 建议的语言列表
    "css.enabledLanguages": [
        "html",
        "django-html",
        "css",
        "java",
    ],

    // ------------------ auto-close-tag  ------------------
    // vscode和Submlit Text模式
    "auto-close-tag.fullMode": false,
    // 用</关闭tag
    "auto-close-tag.SublimeText3Mode": true,
    // 设置扩展将被激活的语言
    "auto-close-tag.activationOnLanguage": [ "*" ],

    // ------------------ eslint  ------------------
    // 状态栏显示
    "eslint.alwaysShowStatus": true,
    // 启用eslint格式化
    "eslint.format.enable": true,

    // ------------------ liveServer  ------------------
    // 如果HTML中缺少正文、标题或其他支持标记,则关闭提示警告消息
    "liveServer.settings.donotVerifyTags": true,
    // 禁止弹出消息
    "liveServer.settings.donotShowInfoMsg": true,
    // 服务端口号, 0:随机端口号
    "liveServer.settings.port": 0,

    // ------------------ Path Intellisense  ------------------
    // 路径智能感知,自动导入路径
    "typescript.suggest.paths": true,

    // ------------------ python  ------------------
    // 限制文档大纲中符号树的深度。
    "python.analysis.symbolsHierarchyDepthLimit": 100,
    // 提供auto-import完成。
    "python.analysis.autoImportCompletions": false,
    // python扩展更新时显示开始页面
    "python.showStartPage": false,
    // 诊断分析模式 workspace: 分析并报告工作空间中所有文件的错误。
    "python.analysis.diagnosticMode": "openFilesOnly",
    // 类型检查的默认规则集
    "python.analysis.typeCheckingMode": "basic",
    // 默认语言服务类型
    "python.languageServer": "Pylance",
    // pylance的告警配置,value参照下面网址,警告级别分为error, warning, infomation, none
    // https://github.com/microsoft/pylance-release/blob/main/DIAGNOSTIC_SEVERITY_RULES.md#diagnostic-severity-rules
    "python.analysis.diagnosticSeverityOverrides": {
        "reportGeneralTypeIssues": "none",
        "reportOptionalMemberAccess": "none",
        "reportWildcardImportFromLibrary": "none",
        // 空类型没有回调
        "reportOptionalCall": "information",
        "reportOptionalSubscript": "none",
        "reportOptionalOperand": "none"
    },
    // 自动给函数添加括号
    "python.autoComplete.addBrackets": true,
    // 把有意义的错误堆栈映射到源码
    "python.diagnostics.sourceMapsEnabled": true,
    // 格式化方式
    "python.formatting.provider": "yapf",
    // 每周更新Python插件
    "python.insidersChannel": "weekly",
    // 长代码不自动换行
    "python.formatting.yapfArgs": [
        // "--max-line-length=86"
    ],
    // 代码分析保存在内存中,在大型文件中可以提高效率,会占用内存
    "python.analysis.memory.keepLibraryAst": true,
    // 函数补全中添加括号 beforeWhitespace: 仅当光标位于空白字符左侧时,才自动闭合括号
    "python.analysis.completeFunctionParens": true,
    // 当找不到类型存根时解析包的源代码
    "python.analysis.useLibraryCodeForTypes": true,

    // 额外的导入搜索解析路径
    "python.analysis.extraPaths": [

    ],
    // 导入需要Python提示且不在path中的库的路径
    "python.autoComplete.extraPaths": [

    ],

    // ------------------ kite  ------------------
    // kite欢迎界面
    "kite.showWelcomeNotificationOnStartup": false,
    // 调用kite引擎获取当前状态的时间间隔(ms)
    "kite.pollingInterval": 2000,

    // ------------------ IntelliCode  ------------------
    // IntelliCode 深度学习
    "vsintellicode.features.python.deepLearning": "enabled",
    // 为 Python 启用 Visual Studio IntelliCode 完成功能
    "vsintellicode.python.completionsEnabled": true,
    // 为 sql 启用 Visual Studio IntelliCode 完成功能
    "vsintellicode.sql.completionsEnabled": true,
    // 为 js 启用 Visual Studio IntelliCode 完成功能
    "vsintellicode.typescript.completionsEnabled": true,

    // ------------------ better comments ------------------
    // 注释着色
    "better-comments.tags": [
        {
            "tag": "!",
            "color": "#FF2D00",
            "strikethrough": false,
            "underline": false,
            "backgroundColor": "transparent",
            "bold": false,
            "italic": false
        },
        {
            "tag": "?",
            "color": "#3498DB",
            "strikethrough": false,
            "underline": false,
            "backgroundColor": "transparent",
            "bold": false,
            "italic": false
        },
        {
            "tag": "//",
            "color": "#474747",
            "strikethrough": true,
            "underline": false,
            "backgroundColor": "transparent",
            "bold": false,
            "italic": false
        },
        {
            "tag": "todo",
            "color": "#FF8C00",
            "strikethrough": false,
            "underline": false,
            "backgroundColor": "transparent",
            "bold": false,
            "italic": false
        },
        {
            "tag": "*",
            "color": "#98C379",
            "strikethrough": false,
            "underline": false,
            "backgroundColor": "transparent",
            "bold": false,
            "italic": false
        }
    ],
    // 从新行开始注释
    "autoDocstring.startOnNewLine": true,
    
    // ------------------ sync setting ------------------
    // 不同步
    "settingsSync.ignoredSettings": [
        "editor.fontSize"
    ],

}