天天看點

vscode 設定縮進為4_VS Code 設定縮進為4個空格

VS Code預設縮進為2兩個空格,修改為4個空格的方法。

一、首選項->設定,設定"editor.detectIndentation": false

vscode 設定縮進為4_VS Code 設定縮進為4個空格

二、ctrl+shift+x 打開插件下載下傳頁面,搜尋beautify插件下載下傳

vscode 設定縮進為4_VS Code 設定縮進為4個空格
vscode 設定縮進為4_VS Code 設定縮進為4個空格

三、在使用者配置中,配置beautify(使用者配置打開方式見步驟一)

{

"beautify.language": {

"js": {

"type": [

"javascript",

"json"

],

"filename": [

".jshintrc",

".jsbeautify"

]

},

"css": [

"css",

"scss",

"less"

],

"html": [

"htm",

"html",

"vue"

]

},

"[html]": {

"editor.defaultFormatter": "vscode.html-language-features"

},

"less.lint.validProperties": [

"\"compress\": false",

"\"sourceMap\": false"

],

"less.compile": {

"compress": false,

"sourceMap": false,

"out": true,

"outExt": ".css",

},

"git.ignoreMissingGitWarning": true,

"[css]": {

"editor.defaultFormatter": "esbenp.prettier-vscode"

},

"[javascript]": {

"editor.defaultFormatter": "HookyQR.beautify"

},

"beautify.config": {

"brace_style":"collapse,preserve-inline",

"indent_size": 4

},

"editor.detectIndentation": false

}

.