一. vscode配置

1. 设置vue文件格式化

 

"workbench.editor.enablePreview": false, // 是否允许预览
"editor.detectIndentation": false, // 默认根据文件类型预测空格数关闭
"editor.insertSpaces": true, // 自动插入空格
"editor.tabSize": 2, // 代码缩进修改成2个空格
"prettier.eslintIntegration": true,  //让prettier使用eslint的代码格式进行校验
"prettier.semi": false,  //去掉代码结尾的分号
"prettier.singleQuote": true,  //使用单引号替代双引号
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
//让函数(名)和后面的括号之间加个空格
"editor.renderControlCharacters": true, // 控制器是否显示控制字符
"editor.renderWhitespace": "all" // 在空白字符上显示符号的方式

2. vetur配置

 

"vetur.format.defaultFormatter.html": "js-beautify-html" // vue中格式化html代码
"emmet.useNewEmmet": false,
"emmet.showAbbreviationSuggestions": true,
"emmet.showExpandedAbbreviation": "always", // required to work with
"emmet.includeLanguages": {
  "vue-html": "html",
  "vue": "html",
  "*.tpl": "html"
},
"files.associations": {
  "*.tpl": "html"
},
"emmet.triggerExpansionOnTab": true,
"emmet.syntaxProfiles": {
  "vue-html": "html",
  "vue": "html"
},

3. Document This插件配置

 

"docthis.includeAuthorTag": true, //出现@Author
"docthis.includeDescriptionTag": true, //出现@Description
"docthis.authorName": "halapro.liu",

4. eslint插件配置

 

"eslint.autoFixOnSave": true, // 每次保存的时候按eslint风格修复
"eslint.validate": [
    "javascript",
    "javascriptreact",
    {
      "language": "vue",
      "autoFix": true
    }
]

5. Iterm2

 

"terminal.external.osxExec": "iTerm.app", // 修改vsc的终端为iTerm2

6. Code Runner插件控制台乱码

 

"code-runner.runInTerminal": true

7. Indent-rainbow插件

 

"indentRainbow.indentSetter": {
  "javascript": { "tabSize": 2, "insertSpaces": true }
}

8.koroFileHeader

 

"fileheader.customMade": {
    "Descripttion": "",
    "version": "",
    "Author": "xxx",
    "Date": "Do not edit",
    "LastEditors": "xxx",
    "LastEditTime": "Do not Edit"
  },
  //函数注释
  "fileheader.cursorMode": {
    "name": "",
    "test": "test font",
    "msg": "",
    "param": "",
    "return": ""
  }

9.beautify

 

// js文件末尾添加一行空行
"files.insertFinalNewline": true,

二. vscode插件

  • Auto Close Tag
  • Auto Rename Tag
  • Auto Import
  • Beautify
  • Bracket Pair Colorizer
  • Code Runner
  • Document This
  • File Peek
  • File Utils
  • GitLens
  • goTo
  • indent-rainbow
  • Project Manager
  • Vertu
  • view-in-browser
  • koroFileHeader

 

Logo

前往低代码交流专区

更多推荐