I am learning Vim but I thought this was a simple task but I cannot get it to work. I have browser SO but the solutions are not working for me.
I am trying to correc
Jesse Hogan's answer is good, but I'd rather more simple answer:
While you are in vim and your XML file is opened, in normal mode write this:
:%!xmllint --format %
then press Enter. All of your XML file will be formatted.
remember you should have installed xmllint before.