1.打開vs code > 文件 > 首選項 > 設置 > 將下面一段粘貼在右側即可
// Place your settings in this file to overwrite the default settings
{
"python.formatting.provider": "yapf",
"view-in-browser.customBrowser": "chrome",
"files.associations": {
"*.vue": "vue"
},
"eslint.options": {
"extensions": [
".js",
".vue"
]
},
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/dist": true
},
"emmet.syntaxProfiles": {
"javascript": "jsx",
"vue": "html",
"vue-html": "html"
},
"window.title": "${dirty}${activeEditorMedium}${separator}${rootName}",
// 窗口失去焦點自動保存
"files.autoSave": "off",
// 編輯粘貼自動格式化
"editor.formatOnPaste": true,
// 控制字體系列。
// "editor.fontFamily": "pingfang,Menlo, Monaco, 'Courier New', monospace",
// 通過使用鼠標滾輪同時按住 Ctrl 可縮放編輯器的字體
"editor.mouseWheelZoom": false,
// 行太長自動換行
"editor.wordWrap": "on",
//Windows bash終端"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
// 主體
"workbench.colorTheme": "Monokai",
"workbench.iconTheme": "vs-seti",
// eslint設置
"eslint.validate": [
"javascript",
"javascriptreact",
"html",
"vue",
{
"language": "vue",
"autoFix": true
}
],
// 保存自動修復
"eslint.autoFixOnSave": true,
// tab鎖緊
"editor.tabSize": 2,
// 保存自動化
"editor.formatOnSave": true,
// 空格變成......
"editor.renderWhitespace": "all",
"window.zoomLevel": 0,
"vetur.format.defaultFormatter.html": "js-beautify-html"
}