On 4/10/07, Peter Hodge <[EMAIL PROTECTED]> wrote:
Hello,

You'll probably need to use 'execute':

  execute 'syn match myPattern' s:mypattern

but again, highlighting won't work for you then.
I see what you're talking about in the syntax files like rst, c, sql, and gdb.
I wonder how hard it would be to modify the vim.vim syntax file to highlight
just that construct, e.g. execute 'syn...'.

--- Ian Tegebo <[EMAIL PROTECTED]> wrote:

> Is doesn't seem possible to store my patterns in variables for use in syntax
> definitions like the following:
>
> let s:mypattern = '#.*'
> syn match myPattern s:mypattern
>
> I get 'pattern delimiter not found' and what not.  Is there a way to achieve
> this?
>
> The general "problem" I'm trying to solve is having to update patterns in
> syntax files when they're used in multiple places and to reduce the line
> length of syntax definitions; I've tried using line continuations but
> highlighting in the definition file itself seems to fail in this case.
>
> --
> Ian Tegebo
>


Send instant messages to your online friends http://au.messenger.yahoo.com



--
Ian Tegebo

Reply via email to