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: vim
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…
I rox0r
I have some music files on my server that are accessible through http (only by me). So instead of keeping them on my laptop, I decided to add the URL’s to Winamp. But that was too painful. So I took the html files and stripped out the tags (using sed) so that I have the…