Nevertheless, I've stumbled over a new combination of vim-foo by Rajashekar Chintalapati today:
- First join all the lines - ggVGgJ
- Now break tags to new lines - :%s/>\s*</>\r</g
- Now set filetype - :set ft=html (you can do this before too)
- Now Indent - ggVG=
The magic spell formula again, in ONE row (just to try being cool):
Code: Select all
ggVGgJ :%s/>\s*</>\r</g :set ft=html ggVG=