Vim's Feature of the Day #2: Context-Aware Completion for XML(in 5 minutes!!!)You're editing yet another Debian sub-policy. Of course the policy is written in Docbook XML and (should I even need to mention it?) of course you're using Vim. The Docbook v4.4 specification is huuuuge and you happen to know just a tiny teeny part of it. Hence you're dreaming of XML Spy or Emacs context-aware completion. Shame on you misbeliever!, Vim can do the same!! Here is how to set-up in 9 easy steps context aware completion for Docbook v4.4 with Vim7 in Debian/unstable:
Now just start Vim on an .xml file containing some Docbook markup and let the fun begin:
Warnings: dtd2vim is a recent addition to vim-scripts, you will need >= 7.05. If you start editing a file which Vim is not yet able to recognized as a Docbook file (e.g. an empty file) don't panic, setf docbk is your friend. Enjoy! PS an even higher fun level while editing XML with Vim can be obtained using the "xml" ftplugin shipped by vim-scripts ...
Leave a comment
|
