{
"files.associations": {
"*.vue": "vue",
"*.wpy": "vue",
"*.wxml": "html",
"*.wxss": "css",
"*.html": "html"
},
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
"git.enableSmartCommit": true,
"git.autofetch": true,
"emmet.triggerExpansionOnTab": true,
"emmet.showAbbreviationSuggestions": true,
"emmet.showExpandedAbbreviation": "always",
"emmet.includeLanguages": {
"vue-html": "html",
"vue": "html",
"wpy": "html"
},
"git.confirmSync": false,
"explorer.confirmDelete": false,
"editor.fontSize": 14,
"window.zoomLevel": 1,
"editor.wordWrap": "on",
// 控制编辑器是否应在对屏幕阅读器进行了优化的模式下运行。设置为“开”将禁用自动换行。
// - auto: 编辑器将使用平台 API 以检测是否附加了屏幕阅读器。
// - on: 编辑器将针对与屏幕阅读器搭配使用进行永久优化。将禁用自动换行。
// - off: 编辑器将不再对屏幕阅读器的使用进行优化。
"editor.accessibilitySupport": "auto",
"editor.detectIndentation": false,
// - off: 永不换行。
// - on: 将在视区宽度处换行。
// - inherit: 将根据 `editor.wordWrap` 设置换行。
"diffEditor.wordWrap": "inherit",
// 控制编辑器中可由屏幕阅读器一次读出的行数。我们检测到屏幕阅读器时,会自动将默认值设置为 500。警告: 如果行数大于默认值,可能会影响性能。
"editor.accessibilityPageSize": 10,
"diffEditor.ignoreTrimWhitespace": false, // 启用后,差异编辑器将忽略前导空格或尾随空格中的更改。
// 重新设定tabsize
"editor.tabSize": 2,
// #值设置为true时,每次保存的时候自动格式化;
"editor.formatOnSave": true,
//每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": false,
"singleQuote": true
},
"prettier": {
"printWidth": 200, // 代码宽度 js超过 300换行
"bracketSameLine": true,
"trailingComma": "none", //禁止随时添加逗号,这个很重要。找了好久
"singleQuote": true, // 单引号不自动转换双引号
"semi": false, // 不添加分号
"proseWrap": "preserve", // 代码超出是否要换行 preserve保留
"arrowParens": "avoid", // 箭头函数一个参数不加括号
"editor.tabSize": 2
},
"prettyhtml": {
"printWidth": 160,
"singleQuote": false,
"wrapAttributes": false,
"sortAttributes": false
}
},
"workbench.iconTheme": "vscode-icons",
"vsicons.dontShowNewVersionMessage": true,
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"backgroundCover.autoStatus": true,
"editor.tabCompletion": "on", // 用来在出现推荐值时,按下Tab键是否自动填入最佳推荐值
// "editor.codeActionsOnSave": {
// "source.fixAll.eslint": true,
// "source.organizeImports": true // 这个属性能够在保存时,自动调整 import 语句相关顺序,能够让你的 import 语句按照字母顺序进行排列
// },
"editor.lineNumbers": "on", // 设置代码行号
"terminal.integrated.shell.osx": "zsh",
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"files.autoSave": "afterDelay",
"liveServer.settings.donotShowInfoMsg": true,
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.unicodeHighlight.invisibleCharacters": false,
"editor.unicodeHighlight.ambiguousCharacters": false
}
参考: