vscode setting.json高效优雅漂亮的配置

643 阅读2分钟
{
  "editor.guides.bracketPairs": true, // 在括号之间显示匹配的光标导航线
  "editor.fontFamily": "'Fira Code'", // 字体家族
  "editor.fontLigatures": true, // 启用字体连字 ligatures
  "terminal.integrated.fontFamily": "monospace", // 终端字体家族
  "editor.minimap.enabled": false, // 禁用代码迷你地图
  "editor.codeActionsOnSave": {
    // 在保存文件时执行的代码操作
    "source.fixAll.eslint": true, // 自动修复 ESLint 问题
    "source.organizeImports": true, // 自动整理导入语句
    "source.fixAll": true // 执行所有可用的修复操作
  },
  "search.followSymlinks": false, // 不跟踪符号链接进行搜索
  "files.exclude": {
    // 要在资源管理器中排除的文件和文件夹
    "**/.git": true,
    "**/.svn": true,
    "**/.hg": true,
    "**/CVS": true,
    "**/.DS_Store": true,
    "**/tmp": true,
    "**/node_modules": false, // 不排除 node_modules 文件夹
    "**/bower_components": true,
    "**/dist": true
  },
  "files.watcherExclude": {
    // 要排除的文件和文件夹以进行监视
    "**/.git/objects/**": true,
    "**/.git/subtree-cache/**": true,
    "**/node_modules/**": true,
    "**/tmp/**": true,
    "**/bower_components/**": true,
    "**/dist/**": true
  },
  "explorer.confirmDelete": false, // 在一段时间后自动保存文件
  "editor.formatOnSave": true, // 在保存文件时自动格式化代码
  "vetur.format.defaultFormatter.html": "js-beautify-html", // Vetur HTML 格式化器
  "vetur.format.defaultFormatterOptions": {
    // Vetur 默认格式化选项
    "js-beautify-html": {
      "wrap_line_length": 220,
      "wrap_attributes": "auto",
      "end_with_newline": false
    }
  },
  "editor.formatOnPaste": true, // 在粘贴代码时自动格式化
  "editor.formatOnType": true, // 在输入代码时自动格式化
  "[css]": {
    // CSS 文件的格式化器
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[scss]": {
    // SCSS 文件的格式化器
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[javascript]": {
    // JavaScript 文件的格式化器
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[vue]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[html]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "vetur.completion.scaffoldSnippetSources": {
    // Vetur 智能提示片段来源
    "workspace": "💼",
    "user": "🗒️",
    "vetur": "✌"
  },
  "editor.unicodeHighlight.ambiguousCharacters": false, // 不突出显示 Unicode 字符
  "auto-close-tag.activationOnLanguage": [
    // 在哪些语言中启用自动闭合标签
    "xml",
    "php",
    "blade",
    "ejs",
    "jinja",
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact",
    "plaintext",
    "markdown",
    "vue",
    "liquid",
    "erb",
    "lang-cfml",
    "cfml",
    "HTML (EEx)",
    "HTML (Eex)",
    "plist"
  ],
  "diffEditor.ignoreTrimWhitespace": false, // 工作台颜色主题
  "editor.fontSize": 20, // 编辑器字号
  "files.associations": {
    // 文件关联
    "*.cjson": "jsonc",
    "*.wxss": "css",
    "*.wxs": "javascript"
  },
  "emmet.includeLanguages": {
    // 包括 Emmet 支持的语言
    "wxml": "html"
  },
  "git.confirmSync": false, // 禁用同步仓库时的确认提示
  "editor.inlineSuggest.enabled": true, // 启用内联建议
  "git.openRepositoryInParentFolders": "never", // 永不在父文件夹中打开仓库
  "[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[javascriptreact]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "CodeGPT.query.language": "Chinese", // CodeGPT 查询语言
  "git.autofetch": true, // 自动获取远程分支
  "editor.wordWrap": "on", // 自动换行
  "editor.quickSuggestionsDelay": 100, // 快速建议延迟
  "javascript.validate.enable": true, // 启用 JavaScript 语法验证
  "files.trimTrailingWhitespace": true, // 去除行末尾的空格
  "editor.pathIntellisense.showHiddenFiles": true, // 显示隐藏文件的路径智能感知
  "editor.folding": true, // 启用代码折叠
  "diffEditor.renderSideBySide": true, // 对比编辑器以并排方式显示
  "debug.console.fontSize": 14, // 调试控制台字号
  "editor.codeFolding": true, // 启用代码折叠
  "markdown.preview.fontSize": 16, // Markdown 预览字号
  "markdown.preview.lineHeight": 1.6, // Markdown 预览行高
  "editor.tabSize": 2, // 缩进大小
  "editor.insertSpaces": true, // 使用空格进行缩进
  "files.encoding": "utf8", // 文件编码
  "terminal.integrated.shell.windows": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", // Windows 终端 shell 路径
  "snippetSearch.include": "${workspaceFolder}/**/*.code-snippets", // 代码片段搜索路径
  "editor.snippetSuggestions": "top", // 代码片段建议位置
  "editor.autoClosingBrackets": "always", // 总是自动闭合括号
  "editor.autoClosingQuotes": "always", // 总是自动闭合引号
  // 在保存时移除尾随空白
  "files.trimFinalNewlines": true,
  // 启用文件路径的自动完成
  "editor.suggest.pathSeparator": "auto",
  // 配置代码折叠为只显示注释
  "editor.foldStrategy": "indent",
  // 配置保存时自动格式化 Markdown 文件
  "[markdown]": {
    "editor.formatOnSave": true
  },
  // 配置代码片段提示的触发字符
  "editor.suggest.triggerCharacters": [
    ".",
    ":",
    ">",
    "\"",
    "'",
    "/",
    "@",
    "#",
    "<",
    "*",
    "(",
    " "
  ],
  // 配置标签自动闭合的触发字符
  "html.autoClosingTags": true,
  "xml.autoClosingTags": true,
  // 配置代码折叠为只显示头部注释
  "editor.foldingStrategy": "auto",
  "extensions.ignoreRecommendations": true,
  "git.enableSmartCommit": true,
  "Codegeex.Privacy": false,
  "workbench.colorTheme": "Aura Soft Dark",
  "security.workspace.trust.untrustedFiles": "open",
  "cSpell.userWords": [
    "hevue",
    "previewimagebg"
  ],
  "todohighlight.keywords": [
    "TODO:" ,
      {
          "text": "TODO:",
          "backgroundColor": "#ebbc1a",
      },
  ]
}