vscode 根据不同文件配置缩进空格

因为后期涉及到代码合并,所以html结构决定保留缩进4, 其它文件设为缩进2
    "[javascript]": {
        "editor.insertSpaces": true,
        "editor.tabSize": 2
    },
    "[css]": {
        "editor.insertSpaces": true,
        "editor.tabSize": 2
    },
    "[scss]": {
        //"editor.defaultFormatter": "michelemelluso.code-beautifier",/ 需安装 sass Formatter插件
        "editor.defaultFormatter": "esbenp.prettier-vscode", // 需安装 prettier插件(个人觉得这个好用) 
        "editor.insertSpaces": true,
        "editor.tabSize": 2
    },
    "[html]": {
        "editor.insertSpaces": true,
        "editor.tabSize": 4
    },

参考文章:
https://segmentfault.com/q/1010000019673775/a-1020000019674091
https://blog.csdn.net/cuk0051/article/details/108341256
https://www.cqzhong.cn/sm5cgu/

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。