8

im wondering if there is any Sublime Text 3 plugin besides HTML Tidy which is able to reindent or reformat parts of HTML Code

1
  • Potential solutions discussing sublime text 2, but i doubt that the functionality has changed very much: stackoverflow.com/questions/8839753/… Commented Feb 11, 2014 at 21:12

2 Answers 2

36

Thanks a lot for your answer, but i found a nice, built in approach of sublime text. Just select everything (CTRL + a (Windows) or CMD + a (Mac) and click this in the menu

Edit → Line → Reindent

maybe this helps also others

EDIT(2017): You can also use key combination (without need for mouse)

CTRL + SHIFT + P (Windows)
CMD + SHIFT + P (Mac)

then type 'Reindent' and select the fist option 'Indentation: Reindent Lines'

Sign up to request clarification or add additional context in comments.

2 Comments

Note that this only re-indents code and doesn't take care of any other re-formatting issues
This didn't work for me for sublime 3 php files. It does work for html, css and js though.
7

Check out HTML-CSS-JS Prettify. It requires nodejs be installed and in your PATH, but once you get that set up properly it works great. Make sure you read all of the docs, though.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.