vim has an awesome feature, using which you can pipe a range through an external command. This is pretty useful if you’re opening up an un-indented or poorly-indented XML or HTML file. If you want to indent your entire file, simply do the following: :%!tidy -i -xml -q The -i option tells tidy that it…
Tag: editors
vim: removing blank lines
This always seems to get me and I have to figure it out every time. Sometimes I have files with blank lines and I want to get rid of them. Here is how you do it in vim (one of the many ways, actually). First you want to get rid of whitespaces: :%s/^\s\+$// Note: I…