vsCode的一些配置

一、vsCode配置(setting.json)

代码如下:

{
  "editor.suggest.snippetsPreventQuickSuggestions": false,
  "tabnine.experimentalAutoImports": true,
  "emmet.includeLanguages": {
    "explorer.confirmDelete": "true"
  },
  "typescript.disableAutomaticTypeAcquisition": true,
  // 自动保存
  "files.autoSave": "off",
  // 字号
  "editor.fontSize": 14,
  // code snippet
  "editor.suggestSelection": "recentlyUsedByPrefix",
  // Tab 键入最佳选项
  "editor.tabCompletion": "on",
  // 保存时自动格式化 import
  "editor.codeActionsOnSave": {
    "source.fixAll": true,
    "source.organizeImports": true
  },
  // 代码行号
  "editor.lineNumbers": "on",
  // 值设置为true时,每次保存的时候自动格式化;
  "editor.formatOnSave": true,
  "workbench.settings.editor": "json",
  // 光标类型
  "editor.cursorStyle": "line",
  // 最多显示行数
  "editor.accessibilityPageSize": 30,
  // 控制编辑器是否在左括号后自动插入右括号
  "editor.autoClosingBrackets": "beforeWhitespace",
  // 控制编辑器是否在左引号后自动插入右引号。
  "editor.autoClosingQuotes": "beforeWhitespace",
  // 方括号类型具有颜色池
  "editor.bracketPairColorization.independentColorPoolPerBracketType": true,
  // "workbench.iconTheme": "material-icon-theme",
  "files.associations": {
    "*.py": "python"
  },
  // 文件夹紧凑模式显示
  "explorer.compactFolders": false,
  // 默认 lf 结尾
  "files.eol": "\n",
  // vscode update tips
  "update.mode": "none",
  // delete confirm
  "explorer.confirmDelete": false,

  //解决终端显示中文乱码问题
  "files.encoding": "utf8",
  //解决输出端中文乱码
  // "code-runner.runInTerminal": true,

  //控制终端光标是否闪烁。
  "terminal.integrated.cursorBlinking": true,
  //控制是否将终端中选定的文本复制到剪贴板。
  "terminal.integrated.copyOnSelection": true,
  //"extensions.ignoreRecommendations": false,
  // extension update
  "extensions.autoUpdate": true,
  // Google Translate plugin configuration
  "commentTranslate.targetLanguage": "zh-CN",
  // 默认格式化方式,统一为 prettier
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  // prettier 全局配置
  "prettier.semi": false,
  // 一行中代码的最大长度
  "prettier.printWidth": 1000,
  "prettier.singleQuote": true,
  // svg preview config
  "svg.preview.mode": "svg",
  // 彩色括号
  "workbench.colorCustomizations": {
    "editorBracketHighlight.foreground1": "#ffd700",
    "editorBracketPairGuide.activeBackground1": "#ffd7007f",
    "editorBracketHighlight.foreground2": "#da70d6",
    "editorBracketPairGuide.activeBackground2": "#da70d67f",
    "editorBracketHighlight.foreground3": "#87cefa",
    "editorBracketPairGuide.activeBackground3": "#87cefa7f",
    "editorBracketHighlight.foreground4": "#ffd700",
    "editorBracketPairGuide.activeBackground4": "#ffd7007f",
    "editorBracketHighlight.foreground5": "#da70d6",
    "editorBracketPairGuide.activeBackground5": "#da70d67f",
    "editorBracketHighlight.foreground6": "#87cefa",
    "editorBracketPairGuide.activeBackground6": "#87cefa7f",
    "editorBracketHighlight.unexpectedBracket.foreground": "#ff0000"
  },
  "editor.bracketPairColorization.enabled": true,
  // 花括号突出显示
  "editor.guides.bracketPairs": "active",
  // svg formatter
  "[svg]": {
    "editor.defaultFormatter": "jock.svg"
  },
  // python format
  "[python]": {
    "breadcrumbs.showNamespaces": true,
    "editor.defaultFormatter": "ms-python.python",
    "breadcrumbs.showStrings": true
  },
  "code-runner.clearPreviousOutput": true,
  "code-runner.saveFileBeforeRun": true,

  // python language server engine
  "python.languageServer": "Pylance",

  // Golang配置
  "go.useLanguageServer": true,
  "[go]": {
    "editor.formatOnSave": true,
    "editor.codeActionsOnSave": {
      "source.organizeImports": true
    },
    // Optional: Disable snippets, as they conflict with completion ranking.
    "editor.snippetSuggestions": "none"
  },
  "[go.mod]": {
    "editor.formatOnSave": true,
    "editor.codeActionsOnSave": {
      "source.organizeImports": true
    }
  },
  "gopls": {
    // Add parameter placeholders when completing a function.
    "usePlaceholders": true,

    // If true, enable additional analyses with staticcheck.
    // Warning: This will significantly increase memory usage.
    "staticcheck": false
  },
  "terminal.integrated.fontFamily": "monospace",
  "code-runner.runInTerminal": true,
  "explorer.confirmDragAndDrop": false,
  "terminal.integrated.defaultProfile.windows": "Command Prompt",
  // "workbench.colorTheme": "One Dark Pro Darker",
  "terminal.integrated.inheritEnv": false,
  "workbench.colorCustomizations": {
    // 终端背景色
    // "terminal.background": "#000000",
    // 终端显示颜色
    "terminal.foreground": "#05c49a",
    //字体设置
    "terminal.integrated.fontFamily": "Lucida Console"
  },
  "terminal.integrated.enableMultiLinePasteWarning": false
}

二、快速创建自定义html页面(html.json)

 

代码如下:

{
  "初始化html": {
    //prefix是创建html骨架自定义快捷键
    "prefix": "xs",
    "body": [
      "<!DOCTYPE html>",
      "<html lang=\"en\">",
      "<head>",
      "\t<meta charset=\"UTF-8\">",
      "\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0,maximum-scale=1,minimum-scale=1,user-scalable=no\">",
      "\t<meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">",
      "\t<title></title>",
      "<style> * { margin: 0;\tpadding: 0;\tbox-sizing:border-box;}</style>",
      "</head>",
      "<body>",
      "\t $0",
      "<script>\n",
      "</script>",
      "</body>",
      "</html>"
    ],
    "description": "初始化html"
  }
}

三、vsCode一些快捷键

打开命令面板:Ctrl + Shift + P

重启vsCode:Ctrl + Shift + P   →   输入Reload

猜你喜欢

转载自blog.csdn.net/XiaoSen125_/article/details/131452568