zoukankan      html  css  js  c++  java
  • [vim]在vim中格式化xml

    From: http://blog.sina.com.cn/s/blog_498a6eeb0100v3km.html


    在_vimrc中增加:

    "  格式化xml
    functionXml()
       set filetype=xml
       :%s/></>\r</g"把><替换成>回车<
       :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></zipmode></filesvr></public_req><transsvr_req><head><transcode>TRANSMSG_QUERY</transcode><oper></oper><orgcode></orgcode><channel>03</channel><chndate>20111007</chndate><chntime>002930</chntime><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>

    =================>

    <?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>
               <oper>
               </oper>
               <orgcode>
               </orgcode>
               <channel>03</channel>
               <chndate>20111007</chndate>
               <chntime>002930</chntime>
               <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>

  • 相关阅读:
    Jvm性能监控和常用工具
    JVM内存分配和回收策略
    从ExtensionLoader理解Dubbo扩展机制
    类的加载和双亲委派模型
    截器和过滤器的区别
    Struts2的工作原理
    Action
    StrutsPrepareAndExecuteFilter
    单例模式
    Web工作原理
  • 原文地址:https://www.cnblogs.com/joeblackzqq/p/2432466.html
Copyright © 2011-2022 走看看