XML Editing in Vim
Today i started finishing the pocoo package split branch and tried to convert one template. That again reminded me that my Vim configuration sucked ass for that sort of job. Now I looked for something better and found something that seems to work quite well.
Basically the first thing I did was removing snippets emu completely. It’s a really, really great extension but it’s a bit too slow for me. I guess textmate solves that better than SnippetsEmu, I liked it in the beginning but in real world use cases I just forgot about using it or was faster by actually typing the snippet.
I formerly used the snippets to insert doctype and some tags and closed them myself. Some time before i used the xml.vim plugin but that has some severe bugs like the funny problem i would call “delete a greater than sign and reinsert it to insert yet another closing tag”. Especially stupid if you want to add an attribute to an already existing tag.
The solution: closetag and XML indent with this configuration:
let g:closetag_default_xml=1 autocmd FileType html,htmljinja,eruby let b:closetag_html_style=1 autocmd FileType html,xhtml,xml,htmljinja,eruby source ~/.vim/scripts/closetag.vim
Closing tags is as easy as ^_ and indention works very well.