[TriLUG] conglomerate
Mike M
linux-support at earthlink.net
Thu May 13 20:05:47 EDT 2004
OK. I got something thanks to the hints in this thread.
See below.
On Thu, May 13, 2004 at 04:33:30PM -0400, Mike M wrote:
> On Thu, May 13, 2004 at 01:24:51PM -0400, Timothy A. Chagnon wrote:
> > On Thu, 2004-05-13 at 13:06, Brian Weaver wrote:
> > > Why not used a markup comment to tell VIM what you want the syntax to
> > > be?
> > >
> > > For example, in the first or last five lines do:
> > >
> > > <!--
> > > vim:ft=xml
> > > -->
> > >
> > > -Weave
> >
> > Yeah, that works, I took a look at the filetypes.vim though and you
> > should use ft=docbk for those DocBook documents
> >
> > <!--
> > vim:ft=docbk
> > -->
> >
> > Works good here.
>
> No good here:
>
> $ vi /usr/share/vim/vim61/filetype.vim
>
> we see:
>
> " SGML
> au BufNewFile,BufRead *.sgm,*.sgml
> \ if getline(1).getline(2).getline(3).getline(4).getline(5) =~?
> 'linuxdoc' |
> \ setf sgmllnx |
In the chapter chunks, in one of the first 2 lines of the file, put in the
following comment line:
<!--<!DOCTYPE "DocBook">vim syntax keywords-->
which will cause this condition to be true:
> \ elseif getline(1) =~ '<!DOCTYPE.*DocBook' ||
> getline(2) =~ '<!DOCTYPE.*DocBook' |
> \ let b:docbk_type="sgml" |
> \ setf docbk |
> \ else |
> \ setf sgml |
> \ endif
>
> There is a reference to docbk filetype. Getting close but no cigar yet.
Works perfectly.
--
Mike
Moving forward in pushing back the envelope of the corporate paradigm.
More information about the TriLUG
mailing list