Skip to content

Instantly share code, notes, and snippets.

@ptitfred
Created August 20, 2012 08:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptitfred/3402279 to your computer and use it in GitHub Desktop.
Save ptitfred/3402279 to your computer and use it in GitHub Desktop.
Pretty format your XML in VIM
function! PrettyXML()
silent %!xmllint --format --encode UTF-8 --recover - 2>/dev/null
endfunction
command! Fxml call PrettyXML()
"-- format xml when trigger Ctrl-Shift-F (only if filetype=xml)
autocmd FileType xml map <C-S-F> :Fxml<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment