自用 VsCode 配置

267 阅读1分钟

VsCode 配置文档

{
    // 需要补齐代码的文件格式
  "files.associations": {
  "*.vue": "vue",
  "*.wpy": "vue",
  "*.wxml": "html",
  "*.wxss": "css"
  },
  "terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
  // 自动全部 Commit
  "git.enableSmartCommit": true,
  // 自动 fetch
  "git.autofetch": true,
  // 文本不是 Emmet 缩写时,允许使用 Tab 键进行缩进
  "emmet.triggerExpansionOnTab": true,
  // Emmet 提示
  "emmet.showAbbreviationSuggestions": true,
  // 控制 Emmet 建议
  "emmet.showExpandedAbbreviation": "always",
  // Emmet 语言
  "emmet.includeLanguages": {
  "vue-html": "html",
  "vue": "html",
  "wpy": "html"
  },
  //主题颜色
  //"workbench.colorTheme": "Monokai",
  // 同步 git 存储库之前确认
  "git.confirmSync": false,
  // 通过垃圾箱删除文件时是否需要确认
  "explorer.confirmDelete": false,
  "editor.fontSize": 14,
  // 窗口缩放级别
  "window.zoomLevel": 1,
  // 是否换行
  "editor.wordWrap": "on",
  "editor.detectIndentation": false,
  // 重新设定tabsize
  "editor.tabSize": 2,
  //失去焦点后自动保存
  "files.autoSave": "onFocusChange",
  // #值设置为true时,每次保存的时候自动格式化;
  "editor.formatOnSave": false,
   //每120行就显示一条线
  "editor.rulers": [
  ],
  // 在使用搜索功能时,将这些文件夹/文件排除在外
  "search.exclude": {
      "**/node_modules": true,
      "**/bower_components": true,
      "**/target": true,
      "**/logs": true,
  },
  // 这些文件将不会显示在工作空间中
  "files.exclude": {
      "**/.git": true,
      "**/.svn": true,
      "**/.hg": true,
      "**/CVS": true,
      "**/.DS_Store": true,
      "**/*.js": {
          "when": "$(basename).ts" //ts编译后生成的js文件将不会显示在工作空中
      },
      "**/node_modules": true
  },
  // #让vue中的js按"prettier"格式进行格式化
  "vetur.format.defaultFormatter.html": "js-beautify-html",
  "vetur.format.defaultFormatter.js": "prettier",
  "vetur.format.defaultFormatterOptions": {
      "js-beautify-html": {
          // #vue组件中html代码格式化样式
          "wrap_attributes": "force-aligned", //也可以设置为“auto”,效果会不一样
          "wrap_line_length": 200,
          "end_with_newline": false,
          "semi": true,
          "singleQuote": true
      },
      "prettier": {
          "semi": true,
          "singleQuote": true
      }
  }
}