Vim indent xml file

后端 未结 9 1814
北恋
北恋 2020-12-07 08:05

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

9条回答
  •  被撕碎了的回忆
    2020-12-07 08:34

    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.

提交回复
热议问题