views:

787

answers:

3

how can I easily indent html files with linux or vi or vim.

+8  A: 

If your vim knows it's an html file (:se filetype=html), you can use the default indentation method (gg=G). I would have a look at :help =, it's quite powerful

soulmerge
great! works ok for me
flybywire
+1  A: 

Use an HTML tidy plugin. Here is some help for vim

Chazadanga
+1  A: 

You can use the html tidy program to have your html file(s) indented. It could also potentially correct things and change more than just indentation, so it might do more than you ask for, but unless that is a problem you will end up with better html files as a result of running tidy.

hlovdal