Hi Tony, On Tue, Jul 18, 2006 at 01:28:22PM +0200, A.J.Mechelynck wrote: > David Purton wrote: > >Hi all, > > > >I gather that the vim7 xml omnicomplete needs a data file to work - > >which is fair enough, since you can get all the attributes as well this > >way. > > > >But, how can I get a generic xml omnifunction system where vim will just > >close the last open tag for me. > > > >eg, at present, for html, I have vim set up to close the current tag as > >soon as I type '</' > > > > > >cheers > > > >dc > > > > > > > > Such "generic" xml/html ftplugins are distributed with Vim. You must > "activate" them by having one (not all) of the following lines in your > vimrc: > > filetype plugin on > filetype plugin indent on > source $VIMRUNTIME/vimrc_example.vim > runtime vimrc_example.vim
[SNIP] Ah - it seems I'm missing something. I have this sort of thing in my .vimrc already and omni-complete works just fine for any xml type that has an xml-omni-datafile in autoload/xml. But what about xml data types that do not have a datafile? eg, when I do something like this: $ touch foo.xml $ vim foo.xml Then enter in the following into vim: <?xml version="1.0" encoding="UTF-8"?> <foo> </<C-X>C-O> omni complete doesn't work. I get: -- Omni completion (^O^N^P) Pattern not found I first need to use :XMLns *something* Then tag completion works. The *something* just needs to be one of the datafiles - doesn't seem to matter which one. But of course there is extraneous info in these data files. For the simple case above, all I want is tag completion. Does that make sense? cheers dc -- David Purton Haese & Harris Publications Phone: +61 8 8355 9444 Email: [EMAIL PROTECTED] Fax: +61 8 8355 9471 Web: http://www.haeseandharris.com.au/
