I've got a lot of HTML files, some of them with garbage indentation.
How can I select a block, and then prettify/reindent the HTML within, adding in newlines where appropriate? I can install any plugin necessary.
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.Sign up to join this community
:h 'equalprg'—you can set this to, e.g.,
prettify for html filetypes by placing a
Then, use the
= operator over a motion, text object, or Visual selection to prettyify that code.