vscode 格式化缩进

使用vscode alt+shift+f格式vue代码,设置如下
template 用的时pug,请问怎么设置能够使pug的缩进都4个空格,

{
    "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",
    
}
阅读 6.3k
2 个回答

每个格式化的插件都不一样。你要针对每个语言的插件配置格式化方案。

可以试试这个插件 EditorConfig for VS Code

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题