Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 formatter/pretty printer for vim?

Tags:

vim

What's the best way get text formatting/pretty printing for HTML5 in Vim?

I just tried HTML Tidy (from Ubuntu 12.04 repo) and by default it seems to not recognize HTML5 tags like Header, Footer, Article, Section, and tries to throw them out. I don't see an obvious switch or config setting to fix this.

Is there a better option? I'd be happy with just being able to batch fix indentations, anything beyond that is gravy.

like image 793
Kurtosis Avatar asked Mar 13 '26 15:03

Kurtosis


1 Answers

You may want to have a look at installing a syntax file or plugin for Vim geared towards HTML5. Such as this by othree. Afterwards you should be able to gg=G to format your HTML.

While we're on the topic, you may want to install emmet.vim a handy dandy zencoding like plugin for Vim which will make writing any HTML much quicker.

like image 117
Battleroid Avatar answered Mar 16 '26 05:03

Battleroid



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!