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

前端 未结 4 584
小鲜肉
小鲜肉 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 14:04

    Create a Keybinding

    To auto indent on Sublime text 3 with a key bind try going to

    Preferences > Key Bindings - users

    And adding this code between the square brackets

    {"keys": ["alt+shift+f"], "command": "reindent", "args": {"single_line": false}}
    

    it sets shift + alt + f to be your full page auto indent.

    Source here

    Note: if this doesn't work correctly then you should convert your indentation to tabs. Also comments in your code can push your code to the wrong indentation level and may have to be moved manually.

提交回复
热议问题