Formatting XML & HTML with HTML Tidy

31 July 2008
by Billy Czajkowska
  1. Get the tidy program from http://www.w3.org/People/Raggett/tidy/
  2. Unzip and run it from the command line, or, place it in your VIM runtime directory, add the following lines to your .vimrc, and when you visually select some text and type ,x on the command line, the selected text will be indented.

“—–
” select xml text to format and hit ,x
vmap ,x :!tidy -q -i –newline LF -xml<CR>
“—
 

Our Latest News