Loading ...
Sorry, an error occurred while loading the content.

syntax problems

Expand Messages
  • Thomas Köhler
    Hi, I m currently working on StoryServer templates. That s mostly html, containing embedded tcl. Now, I have my own version of html.vim: au! Syntax html so
    Message 1 of 1 , Jul 5 4:31 AM
    • 0 Attachment
      Hi,
      I'm currently working on StoryServer templates. That's mostly html,
      containing embedded tcl. Now, I have my own version of html.vim:
      au! Syntax html so ~/vim/mysyntaxfiles/html.vim
      In this file, I added a few extra lines like this:

      if main_syntax == 'storyserver'
      syn match embTclComment +\[\s*#.*\]+
      syn match tclMatch +<=+
      syn match tclMatch +< +me=e-1
      syn region embTcl start=+\[+ end=+\]+ contains=embTclComment,embTcl,@htmlTcl,htmlTag,htmlEndTag,tclMatch
      syn include @htmlTcl <sfile>:p:h/tcl.vim

      syn cluster htmlPreproc add=embTcl
      syn cluster htmlPreproc add=embTclComment
      endif

      Now, what's the problem? Here it is: embedded tcl can also be nested, so
      every syntax item in tcl.vim should also have a
      "contains=embTcl,embTclComment" added. (of course, syn keyword could be
      ignored).
      I did this for tclString for the moment, but the real problem is: Now, I
      also need an extra copy of tcl.vim, not only of html.vim - this is bad.
      Is it possible to change vim to allow something like this?
      syn include @htmlTcl <sfile>:p:h/tcl.vim contains=embTcl,embTclComment
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      this is the new part: add
      contains to all syntax items
      from tcl.vim

      (the next problem, to match HTML-Tags within embeded tcl parts, while
      <,>,<=,>= are also allowed is just another piece of fun so far: without
      the above tclMatch hack, highlightning just goes mad :-))

      CU,
      Thomas

      --
      Thomas Köhler Email: jean-luc@... | LCARS - Linux
      <>< WWW: http://jeanluc-picard.de | for Computers
      IRC: jeanluc | on All Real
      PGP public key available from Homepage! | Starships
    Your message has been successfully submitted and would be delivered to recipients shortly.