settings.json中编辑

settings.json中编辑


python 复制代码
{
    /* ===================== Python 语言专属配置(优先级高于全局) ===================== */
    "[python]": {
        // 对比Python代码差异时,不忽略首尾的空白字符(便于检查空格相关的代码问题)
        "diffEditor.ignoreTrimWhitespace": false,
        // 禁用Python文件中的颜色装饰器(不显示颜色值对应的小色块预览)
        "editor.defaultColorDecorators": "never",
        // 在Python文件中输入代码时(如按回车),自动格式化当前行代码
        "editor.formatOnType": true,
        // Python文件的代码自动提示规则配置
        "editor.quickSuggestions": {
            // 普通代码区域(非注释/字符串)开启自动提示
            "other": "on",
            // 注释区域关闭自动提示(避免干扰注释编写)
            "comments": "off",
            // 字符串区域开启自动提示(如字符串拼接时的提示)
            "strings": "on"
        },
        // 关闭基于单词的模糊提示,只显示语法/库相关的精准提示
        "editor.wordBasedSuggestions": "off"
    },
    /* ===================== 编辑器全局基础配置 ===================== */
    // 全局默认字体大小(后续被内层editor配置覆盖为18,仅作保留)
    "editor.fontSize": 23,
    // 配置文件关联:.xlsx文件使用默认编辑器打开
    "workbench.editorAssociations": {
        "*.xlsx": "default"
    },
    // 删除文件时不弹出确认对话框(简化操作流程)
    "explorer.confirmDelete": false,
    // 文件自动保存规则:切换窗口/标签页焦点时自动保存
    "files.autoSave": "onFocusChange",
    // 粘贴文件到资源管理器时不弹出确认对话框
    "explorer.confirmPasteNative": false,
    // 启用Database Client插件的自动同步功能
    "database-client.autoSync": true,
    // 终端中粘贴多行内容时,永不显示粘贴警告提示
    "terminal.integrated.enableMultiLinePasteWarning": "never",
    // 信任策略:直接打开未受信任的工作区文件(不弹窗提示)
    "security.workspace.trust.untrustedFiles": "open",
    // AI工具调用白名单:仅允许执行python、netstat、findstr、pip命令
    "AI.toolcall.v2.command.allowList": "[\"python\",\"netstat\",\"findstr\",\"pip\"]",
    // AI工具调用规则:始终自动运行MCP(模型控制协议)相关指令
    "AI.toolcall.v2.ide.mcp.autoRun": "alwaysRun",
    // 禁用Python语言服务器(关闭语法检查、智能提示等语言服务)
    "python.languageServer": "None",
    // 禁用basedpyright插件的语言服务功能
    "basedpyright.disableLanguageServices": true,
    // 禁用windsurfPyright插件的语言服务功能
    "windsurfPyright.disableLanguageServices": true,
    // 关闭VS Code的扩展推荐提示(不主动推荐安装扩展)
    "extensions.ignoreRecommendations": true,
    // AI工具调用模式:始终自动运行IDE相关命令
    "AI.toolcall.v2.ide.command.mode": "alwaysRun",
    // 粘贴代码时自动格式化(适配编辑器的代码格式规则)
    "editor.formatOnPaste": true,
    // 粘贴代码时自动适配目标位置的缩进格式
    "editor.autoIndentOnPaste": true,
    // 保存文件时自动格式化整个文件的代码
    "editor.formatOnSave": true,
    // 点击行尾后自动展开折叠的代码块
    "editor.unfoldOnClickAfterEndOfLine": true,
    // 内联建议编辑时,默认显示折叠状态的建议内容
    "editor.inlineSuggest.edits.showCollapsed": true,
    // 关闭Python环境创建的自动触发提示(不主动提示创建虚拟环境)
    "python.createEnvironment.trigger": "off",
    // 差异编辑器计算时间:无限制(0表示不限制计算时长)
    "diffEditor.maxComputationTime": 0,
    // 关闭编辑器顶部的面包屑导航栏(节省界面空间)
    "breadcrumbs.enabled": false,
    // 关闭粘性滚动(函数/类名不会固定在编辑器顶部)
    "editor.stickyScroll.enabled": false,
    // 启用trae插件的标签页摘要自动显示功能
    "trae.tab.enableSummaryAutoDisplay": true,
    // Python文件中默认折叠导入语句(import部分)
    "editor.foldingImportsByDefault": true,
    // 代码折叠策略:基于缩进(Python默认的折叠方式)
    "editor.foldingStrategy": "indentation",
    // 差异编辑器支持的最大文件大小:无限制(0表示不限制)
    "diffEditor.maxFileSize": 0,
    // 笔记本文件备份大小限制:无限制(0表示不限制)
    "notebook.backup.sizeLimit": 0,
    // 工作区本地历史记录的单个文件最大大小:2560KB
    "workbench.localHistory.maxFileSize": 2560,
    // 编辑器最多可同时打开的标签页数量:10000个
    "workbench.editor.limit.value": 10000,
    // 括号对颜色高亮:每种类型的括号使用独立的颜色池(避免颜色重复)
    "editor.bracketPairColorization.independentColorPoolPerBracketType": true,
    // 编辑器标题栏滚动条尺寸:大尺寸
    "workbench.editor.titleScrollbarSizing": "large",
    // 始终显示编辑器标题栏的滚动条
    "workbench.editor.titleScrollbarVisibility": "visible",
    // 始终显示编辑器的操作按钮(如保存、关闭等)
    "workbench.editor.alwaysShowEditorActions": true,
    // 启用鼠标滚轮缩放字体(需配合Ctrl键)
    "editor.mouseWheelZoom": true,
    // 启用粘性制表位(Tab键缩进位置固定)
    "editor.stickyTabStops": true,
    // 启用编辑器右侧的迷你地图(代码缩略图)
    "editor.minimap.enabled": true,
    // trae插件预览权限配置:空对象(默认权限)
    "trae.preview.permission": {},
    // 编辑器核心样式配置(覆盖全局配置)
    "editor": {
        // 代码折叠功能总开关:启用
        "codeFolding": {
            "enabled": true,
            // 代码折叠细分规则
            "settings": {
                // 函数块不自动折叠
                "functions": false,
                // 类块不自动折叠
                "classes": false
            }
        },
        // 最终生效的编辑器字体大小:18号
        "fontSize": 18,
        // 代码行高:2.0倍(默认1.6,更宽松)
        "lineHeight": 2.0
    },
    // JSON模式配置:空数组(无自定义JSON模式)
    "json.schemas": []
}
python 复制代码
{
    "security.workspace.trust.untrustedFiles": "open",
    "workbench.colorTheme": "Oceanic Next (dimmed bg)",
    "workbench.iconTheme": "material-icon-theme",
    "bracket-pair-colorizer-2.depreciation-notice": false,
    "editor.lineHeight": 24,      //控制行间距
    "editor.fontWeight": "normal",    // 控制字体粗细
    "editor.tokenColorCustomizations": {"comments": "#00ff7f",
    "keywords": "#eb6689",
    "numbers": "#00eeff",
    "functions": "#ea65f9"
    },  //控制字体颜色
    "python.defaultInterpreterPath": "D:\\soft\\Anaconda3\\python.exe",
    //"python.linting.flake8Enabled": true,
    //"python.formatting.provider": "yapf",
    //"python.linting.flake8Args": ["--max-line-length=248"],
    //"python.linting.pylintEnabled": false,
    "python.autoComplete.extraPaths": ["D:/soft/Anaconda3/lib/site-packages",],
    "python.analysis.extraPaths": ["D:/soft/Anaconda3",],
    //"vsicons.dontShowNewVersionMessage": true,
    // 配置python语言正常输出中文的环境
    "code-runner.executorMap": {
    "python":"set PYTHONIOENCODING=utf8 && $pythonPath -u $fullFileName"}, 
    "code-runner.respectShebang": false,
    "editor.unicodeHighlight.includeStrings": false,
    "editor.unicodeHighlight.includeComments": false,
//终端颜色配置
    "terminal.integrated.inheritEnv": false,
    "workbench.colorCustomizations": {
        "terminal.background": "#200707",
        "terminal.foreground": "#b4d6af",
        "terminalCursor.background": "#D8D8D8",
        "terminalCursor.foreground": "#D8D8D8",
        "terminal.ansiBlack": "#181818",
        "terminal.ansiBlue": "#0b5e7c",
        "terminal.ansiBrightBlack": "#585858",
 
// 终端命令行  lm@os:
        "terminal.ansiBrightBlue": "#39b9e7",
        "terminal.ansiBrightCyan": "#86C1B9",
        "terminal.ansiBrightGreen": "#ca530f",
        "terminal.ansiBrightMagenta": "#BA8BAF",
        "terminal.ansiBrightRed": "#AB4642",
        "terminal.ansiBrightWhite": "#F8F8F8",
        "terminal.ansiBrightYellow": "#f788f7",
        "terminal.ansiCyan": "#86C1B9",
        "terminal.ansiGreen": "#b57b6c",
        "terminal.ansiMagenta": "#BA8BAF",
        "terminal.ansiRed": "#AB4642",
        "terminal.ansiWhite": "#D8D8D8",
        "terminal.ansiYellow": "#F7CA88",
        "terminal.integrated.cursorBlinking": true,
        "terminal.integrated.lineHeight": 1.6,
        "terminal.integrated.letterSpacing": 0.1,
        "terminal.integrated.fontFamily": "Lucida Console", //字体设置
        "terminal.integrated.shell.linux": "/bin/zsh",
    },
    "[python]": {
        "editor.formatOnType": true
    },
    "vsicons.dontShowNewVersionMessage": true,
    "settingsSync.ignoredExtensions": [
    
    ],
    "settingsSync.ignoredSettings": [

    ],
    "window.zoomLevel": -1,
    "editor.codeActionsOnSave": {
    
    }
}
相关推荐
喵手4 小时前
Python爬虫零基础入门【第九章:实战项目教学·第15节】搜索页采集:关键词队列 + 结果去重 + 反爬友好策略!
爬虫·python·爬虫实战·python爬虫工程化实战·零基础python爬虫教学·搜索页采集·关键词队列
Suchadar5 小时前
if判断语句——Python
开发语言·python
ʚB҉L҉A҉C҉K҉.҉基҉德҉^҉大5 小时前
自动化机器学习(AutoML)库TPOT使用指南
jvm·数据库·python
喵手5 小时前
Python爬虫零基础入门【第九章:实战项目教学·第14节】表格型页面采集:多列、多行、跨页(通用表格解析)!
爬虫·python·python爬虫实战·python爬虫工程化实战·python爬虫零基础入门·表格型页面采集·通用表格解析
0思必得05 小时前
[Web自动化] 爬虫之API请求
前端·爬虫·python·selenium·自动化
莫问前路漫漫6 小时前
WinMerge v2.16.41 中文绿色版深度解析:文件对比与合并的全能工具
java·开发语言·python·jdk·ai编程
木头左6 小时前
Backtrader框架下的指数期权备兑策略资金管理实现与风险控制
python
玄同7656 小时前
LangChain 核心组件全解析:构建大模型应用的 “乐高积木”
人工智能·python·语言模型·langchain·llm·nlp·知识图谱
喵手6 小时前
Python爬虫实战:从零构建 Hacker News 数据采集系统:API vs 爬虫的技术抉择!(附CSV导出 + SQLite 存储)!
爬虫·python·爬虫实战·hacker news·python爬虫工程化实战·零基础python爬虫教学·csv导出
测试老哥6 小时前
软件测试之功能测试详解
自动化测试·软件测试·python·功能测试·测试工具·职场和发展·测试用例