Created
June 17, 2016 05:53
-
-
Save murarisumit/c9aaf0ae45bd576aae3c1447036f5875 to your computer and use it in GitHub Desktop.
Preety print xml and json in vim #vim #json #pretty
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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