VS Code 设置缩进为4个空格

隐身守侯 提交于 2020-04-30 19:32:39

VS Code默认缩进为2两个空格,修改为4个空格的方法。

一、首选项->设置,设置"editor.detectIndentation": false

 

 

二、ctrl+shift+x 打开插件下载页面,搜索beautify插件下载

 

 

三、在用户配置中,配置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
}

  

 

 

 

 

 

.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!