Taking a course in Web Technology, I suddenly found myself editing a lot of XML files, so I hurried to fine-tune VIM to make editing more efficient. Please note that I am by no means an expert in XML, so please correct me, if I have misunderstood something. Configuration in xml.vim. Features:

  • Tag closing with code snippets from xmledit. Press <C-k> once to close the tag, and twice to close it and leave an empty line between.
  • Tag closing using omni-completion: <C-b>. This is used when the cursor is not at the end of the starting tag. Will insert the closing tag for the inner most unclosed starting tag.
  • Cycle between start and end tags with <LocalLeader>5 (typically \5 or ,5)
  • Remove outer tag with <LL>r
  • Goto parent tag with <LL>u (working on it, doesn’t work with <x/> tags. Anybody got a clue how to do this correctly?)
  • Document pretty printing with <LL>xf
  • Wellformedness checking (<LL>xx), DTD validation (<LL>xd) and XML Schema validation (<LL>xs) with XML Catalog support using xmllint (see below)

Have a look at Vim as XML Editor by Tobias Reif to find more tips. continue reading…

  • Facebook
  • Twitter
  • Digg
  • Reddit
  • del.icio.us
  • StumbleUpon