gvim编辑xml更新

上次写的那个gvim编辑xml的方式有点不太好,没有把xml的层级关系列出来,今天找了找,比较完美的解决了gvim编辑和查看xml的问题。

查看xml,需要用到 xmllint,这个是windows版本的,需要放到path里面,其实就是在gvim里能找到就行。然后再gvim的配置中加上这个
let mapleader = ","
map <silent> <leader>px : %!xmllint % --format<cr>
这样在打开xml后,键盘输入,px,就能得到xml的pretty xml效果。

对于编辑,需要 xmledit - A filetype plugin to help edit XML, HTML, and SGML documents ,用这个覆盖掉原来gvim自带的xml.vim,在编辑xml文件时就能省很多事了,照抄文档里说。It allows you to jump to the beginning or end of the tag block your cursor is in. '%' will jump between '<' and '>' within the tag your cursor is in. When in insert mode and you finish a tag (pressing '>') the tag will be completed. If you press '>' twice it will complete the tag and place the cursor in the middle of the tags on it's own line.


转载于:https://www.cnblogs.com/fresky/archive/2010/10/09/1846894.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值