How to set HTML Auto Indent format on Sublime Text 3?

前端 未结 4 575
小鲜肉
小鲜肉 2020-12-08 13:25

I have a question while I\'m writing HTML code on Sublime Text 3. I just want to set auto indent format of HTML. For example, when I write p tag like under code, the indenta

4条回答
  •  攒了一身酷
    2020-12-08 13:47

    One option is to type [command] + [shift] + [p] (or the equivalent) and then type 'indentation'. The top result should be 'Indendtation: Reindent Lines'. Press [enter] and it will format the document.

    Another option is to install the Emmet plugin (http://emmet.io/), which will provide not only better formatting, but also a myriad of other incredible features. To get the output you're looking for using Sublime Text 3 with the Emmet plugin requires just the following:

    p [tab][enter] Hello world!
    

    When you type p [tab] Emmet expands it to:

    Pressing [enter] then further expands it to:

    With the cursor indented and on the line between the tags. Meaning that typing text results in:

    Hello, world!

提交回复
热议问题