一:下載https://code.visualstudio.com/docs/?dv=win 下載好后直接安裝。
二:安裝插件
注:安裝完插件后點任何一個重新加載或者重啟編輯器。
三:更新在幫助里更新;
四:中英文切換:F1 -> 語言設置 -> 修改為zh-CN -> 保存重啟 VSCode
五:設置 文件->首選項->設置
// 將設置放入此文件中以覆蓋默認設置
{
"window.zoomLevel": 1,
"workbench.iconTheme": "vscode-icons",
"emmet.syntaxProfiles": {
"vue-html": "html",
"vue": "html"
},
"files.associations": {
// extension name : html
"*.vue": "vue"
},
// 控制換行方式。可以選擇:
"editor.wordWrap": "on",
// 控制是否顯示 minimap。
"editor.minimap.enabled": true,
// 控制編輯器是否應呈現縮進參考線。
"editor.renderIndentGuides": false,
// 雙擊選中詞語(包含下划線、中橫線等分割的詞語)。
"editor.wordSeparators": "./\\()\"':,.;<>~!@#$%^&*|+=[]{}`~?",
// 窗口失去焦點自動保存文件。
"files.autoSave": "onWindowChange",
// 保存時是否格式化文件的格式。
"editor.formatOnSave": true,
// 以新行結束。
// "html.format.endWithNewline": true,
// js代碼保存時是否在函數括號前添加一個空格。
"javascript.format.insertSpaceBeforeFunctionParenthesis": false, // vue文件保存時style標簽里面的代碼縮進。
"vetur.format.styleInitialIndent": true, // vue文件保存時script標簽里面的代碼縮進。
"vetur.format.scriptInitialIndent": true, // vue文件保存時html標簽里面的屬性對其方式。
"vetur.format.html.wrap_attributes": "auto", // vue文件保存時是否在js函數括號前添加一個空格
"vetur.format.js.InsertSpaceBeforeFunctionParenthesis": false,
"git.confirmSync": false
}
六:參考代碼:
https://jeasonstudio.gitbooks.io/vscode-cn-doc/content/
https://code.visualstudio.com/docs/