From: http://blog.sina.com.cn/s/blog_498a6eeb0100v3km.html
Add the following in _ vimrc:
"Format XML
Functionxml ()
Set filetype = xml
: % S/> </> \ r </g "replace <with> press ENTER <
: Normal Gg = G <CR>
Endfunction
Map <leader> XML: callxml ()
<? Xmlversion = "1.0" encoding = "gb2312"?> <Xrpc> <xrpchead> <version> 1.0 </version> </xrpchead> <public_req> <rpcmode> 0 </rpcmode> <memcache_key> </memcache_key> <MQ> </MQ> <filesvr> <fileflag> </fileflag> <FILENAME> </FILENAME> <filemd5> </filemd5> <zipmode> </filesvr> </ public_req> <transsvr_req>
========================>
<? Xmlversion = "1.0" encoding = "gb2312"?>
<Xrpc>
<Xrpchead>
<Version> 1.0 </version>
</Xrpchead>
<Public_req>
<Rpcmode> 0 </rpcmode>
<Memcache_key>
</Memcache_key>
<MQ>
</MQ>
<Filesvr>
<Fileflag>
</Fileflag>
<FILENAME>
</FILENAME>
<Filemd5>
</Filemd5>
<Zipmode>
</Zipmode>
</Filesvr>
</Public_req>
<Transsvr_req>
<Head>
<Transcode> transmsg_query </transcode>
<Strong>
</Dependency>
<Orgcode>
</Orgcode>
<Channel> 03 </channel>
<Chndate> 20111007 </chndate>
& Lt; chntime & gt; 002930 & lt;/chntime & gt;
<Transdesp>
</Transdesp>
</Head>
<Querymode>
<Maxrecords> 10 </maxrecords>
<Resultmode>
</Resultmode>
<Filemode>
</Filemode>
<OFFSET> 1 </Offset>
<Countall> 1 </countall>
</Querymode>
<Body>
<Date_trans> 20110726 </date_trans>
</Body>
</Transsvr_req>
</Xrpc>