Sunday, August 20, 2017

Re: Creating a syntax file need to grab a global variable to match.

On Saturday, August 19, 2017 at 3:50:29 PM UTC-5, Robert wrote:
> One of the plugins that I use allows the end user to redefine a variable to use different markers for text replacement.
>
> It defaults to:
>
> startDelim is: {{+
> endDelim is: +}}
>
> I would like to grab the global variable g:startDelim and g:endDelim and use that in my syntax matching group.

Bob -
Have you tried something like this:

exe "syntax match mystartKeyword /" . g:startDelim . "/"
exe "syntax match myKeyword /" . g:endDelim . "/"

I've tried it - works fine.

Sergey

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment