简体   繁体   English

Sublime Text 2 HTML使所有标签缩进

[英]Sublime Text 2 HTML indent all tags

I don't like Sublime Text 2's default indentation for HTML. 我不喜欢Sublime Text 2的HTML默认缩进。 I hate fact that it doesn't indent the head and body and body tags. 我讨厌它不会缩进headbody和身体标签的事实。

Specifically, when you reindent everything, it looks like this: 具体来说,当您重新缩进所有内容时,它看起来像这样:

<!doctype html>
<html>
<head>

</head>
<body>
    <div class="main-content">
        <h1>Hello!</h1>
    </div>
</body>
</html>

..and I want it to look like this: ..我希望它看起来像这样:

<!doctype html>
<html>
    <head>

    </head>
    <body>
        <div class="main-content">
            <h1>Hello!</h1>
        </div>
    </body>
</html>

...with the head and body tags one tab space in from the html tag. ...使用headbody标签在html标签中插入一个制表符空间。

Everytime I fix it, then write a bunch of code, then reindent, it sucks everything back to the left and I have to manually fix it. 每次我修复它时,然后编写一堆代码,然后重新缩进,它会将所有内容都吸回左侧,因此我必须手动对其进行修复。

I have searched all over. 我到处搜寻。 There are many settings in HTML.sublime-settings, but none of the deals with this. HTML.sublime-settings中有许多设置,但与此无关。

Thank you in advance. 先感谢您。

I'm sure you can edit the settings file and change tabs to a number of spaces. 我确定您可以编辑设置文件并将选项卡更改为多个空格。 I've done it previously unless I am going crazy. 除非我发疯,否则我以前已经做过。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM