From 9cd50287b88ae11551e997f468765526e9055783 Mon Sep 17 00:00:00 2001 From: James Patrick Date: Sat, 10 Apr 2021 16:39:41 -0400 Subject: [PATCH] Added Formatting command for JSON & XML This requires python3 to be installed along with standard set of modules. --- vim/vimrc.d/base.vim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vim/vimrc.d/base.vim b/vim/vimrc.d/base.vim index 34e1a7b..1871074 100644 --- a/vim/vimrc.d/base.vim +++ b/vim/vimrc.d/base.vim @@ -67,3 +67,6 @@ function! NumberToggle() endif endfunc +"" +com! FormatJson :%!python3 -m json.tool +com! FormatXML :%!python3 -c "import xml.dom.minidom, sys; print(xml.dom.minidom.parse(sys.stdin).toprettyxml())"