鍍金池/ 問(wèn)答/HTML5  HTML/ vscode 格式化縮進(jìn)

vscode 格式化縮進(jìn)

使用vscode alt+shift+f格式vue代碼,設(shè)置如下
template 用的時(shí)pug,請(qǐng)問(wèn)怎么設(shè)置能夠使pug的縮進(jìn)都4個(gè)空格,

{
    "editor.fontSize": 12,
    "emmet.variables": {
        "lang": "zh-cn",
        "charset": "UTF-8"
    },
    "files.associations": {
        "*.wpy": "vue"
    },
    "workbench.startupEditor": "newUntitledFile",
    "todohighlight.isEnable": true,
    "todohighlight.include": [
        "**/*.js",
        "**/*.jsx",
        "**/*.ts",
        "**/*.tsx",
        "**/*.html",
        "**/*.php",
        "**/*.css",
        "**/*.scss",
        "**/*.wpy",
    ],
    "stylusSupremacy.insertColons": false,
    "stylusSupremacy.insertSemicolons": false,
    "stylusSupremacy.insertBraces": false,
    "stylusSupremacy.insertNewLineAroundImports": false,
    "stylusSupremacy.insertNewLineAroundBlocks": false,
    "editor.detectIndentation": false,
    "editor.tabSize": 4,
    "editor.formatOnSave": true,
    "vetur.format.defaultFormatter.js": "vscode-typescript",
    "vetur.format.defaultFormatter.html": "js-beautify-html",
    
}
回答
編輯回答
入她眼

可以試試這個(gè)插件 EditorConfig for VS Code

2017年9月30日 17:13
編輯回答
朕略萌

每個(gè)格式化的插件都不一樣。你要針對(duì)每個(gè)語(yǔ)言的插件配置格式化方案。

2017年2月22日 15:46