VS Code 设置缩进为4个空格

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
}

  

 

 

 

 

 

.

posted @ 2020-04-29 15:16  剑仙6  阅读(6815)  评论(0编辑  收藏  举报
欢迎访问个人网站www.qingchun.在线