Y
Y
yan4eg2014-05-08 16:51:28
HTML
yan4eg, 2014-05-08 16:51:28

SublimeText 3 html code auto alignment?

Good afternoon!
Can you please tell me if it is possible to set up SublimeText 3 in such a way that it automatically aligns/structures the html code when I insert/write it.
That's about what I want HTML code formatting tool
Maybe some kind of plugin. I can't figure out which one and how to set it up.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
E
Eugene Obrezkov, 2014-05-08
@yan4eg

Use hotkeys on Reindent.
Open User Hotkeys and write

[
    {
        "keys": ["ctrl+shift+r"],
        "command": "reindent",
        "args": {
            "single_line": false
            }
        }
]

K
Konstantin Velichko, 2014-05-08
@Zoxon

There are built-in tools
Ctrl+Shift+P → Indentation: Reindent Lines

T
theaidem, 2014-05-08
@theaidem

Bottom right where "Tab size: N" click and select: "Convert Indentation to Tabs"

P
Pavel Belousov, 2014-05-08
@PafNutY

The fact is that auto-formatting is not always required, sometimes (for me at least very often) you need to leave the original formatting in most of the code.
By default, code auto-formatting (indenting, auto-closing tags) is enabled. If you need to format the code - just select it (for reliability, you can still press Ctrl + J) and align with the built-in tools, the methods are given above (or through the context menu)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question