Skip to content

Instantly share code, notes, and snippets.

@murarisumit
Created June 17, 2016 05:53
Show Gist options
  • Save murarisumit/c9aaf0ae45bd576aae3c1447036f5875 to your computer and use it in GitHub Desktop.
Save murarisumit/c9aaf0ae45bd576aae3c1447036f5875 to your computer and use it in GitHub Desktop.
Preety print xml and json in vim #vim #json #pretty
Preety print xml and json in vim
XML:
1. Install xmllint : `sudo apt-get install libxml2-utils`
2. Use xmllint to format the xml
3. Add this to vimrc: `nmap =x :%!xmllint % --format<CR>`
JSON:
0. Needs to have python installed
1. Add this to vimrc : `nmap =j :%!python -m json.tool<CR>`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment