From 2747d85c53d611c0ee4ae2456388954933649d6f Mon Sep 17 00:00:00 2001 From: Ein Verne Date: Thu, 8 Apr 2021 16:12:26 +0800 Subject: [PATCH] Add xml formatter in vimrc --- .vimrc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.vimrc b/.vimrc index b0c691a..167db32 100644 --- a/.vimrc +++ b/.vimrc @@ -338,5 +338,7 @@ endif " source $VIMRUNTIME/vimrc_example.vim " source $VIMRUNTIME/mswin.vim - - +" +" use FormatXML or `=` to format xml need python3 installed +com! FormatXML :%!python3 -c "import xml.dom.minidom, sys; print(xml.dom.minidom.parse(sys.stdin).toprettyxml())" +nnoremap = :FormatXML