Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
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.
Read :h 'equalprg'—you can set this to, e.g., prettify for html filetypes by placing a setlocal in ~/.vim/after/ftplugin/html.vim.
Then, use the = operator over a motion, text object, or Visual selection to prettyify that code.
Required, but never shown