On Thu, 26 Oct 2006, A.J.Mechelynck wrote: > Hugh Sasse wrote: > > On Thu, 26 Oct 2006, A. S. Budden wrote: > > > perl scripts embedded in a single Matlab script. I have done similar > > > things for C and others. > > > > Well, in my .vimrc I now have: > > > > " To MetaProgram C using Ruby > > function RubyMetaC() > > :unlet! b:current_syntax > > :syntax include @CSTUFF syntax/c.vim > > Method I. > > syntax include @CSTUFF $VIMRUNTIME/syntax/c.vim > > This doesn't pick any "local additions" to C syntax, nor does it pick the > "local syntax script" if you've completely replaced the default C syntax > script by something else placed earllier in 'runtimepath'. > > Method II: if you want to search all 'vimruntime' directories > > if has("unix") > silent! syn include @CSTUFF ~/.vim/syntax/c.vim > else > silent! syn include @CSTUFF ~/vimfiles/syntax/c.vim > endif > silent! syn include @CSTUFF $VIM/vimfiles/syntax/c.vim > syn include @CSTUFF $VIMRUNTIME/syntax/c.vim > silent! syn include @CSTUFF $VIM/vimfiles/after/syntax/c.vim > if has("unix") > silent! syn include @CSTUFF ~/.vim/after/syntax/c.vim > else > silent! syn include @CSTUFF ~/vimfiles/after/syntax/c.vim > endif > > Method III (recommended): "include" into your @CSTUFF cluster a file > containing only the single line > > runtime! syntax/c.vim > > This would be equivalent (with fewer keystrokes) to Method II above.
So all these will solve the "my C syntax just looks white" problem? > > > :syntax region rubyC1 matchgroup=String start=+%Q{+ end=+}+ keepend > > [EMAIL PROTECTED] > > :syntax region rubyC2 matchgroup=String start=+%Q(+ end=+)+ keepend > > [EMAIL PROTECTED] > > :syntax region rubyC3 matchgroup=String start=+%Q<+ end=+>+ keepend > > [EMAIL PROTECTED] > > :syntax on > > endfunction > > [...] > > I saw in the tip#856 (earlier in the thread) the use of :hi-link, but can't > > figure out what to link it to so that it picks up all > > C code as C. > > > Hope that is of some interest, > > > > > > Al > > > > > Thank you > > Hugh > > > > > You can probably leave the C highlight groups alone. If you were creating a so I don't need hi-link. OK. I'll try those out > new language, let's say "foobar", you would define a number of syntax groups > for your language, all of them with camel-case names starting "foobar", and > then use > > hi default link foobarFunction Function > hi default link foobarIdentifier Identifier > hi default link foobarComment Comment > > etc. Thank you. > > > Best regards, > Tony. > Hugh