Hi all :)

    Another weird question O:)

    Let's suppose that I search frequently for a very complex pattern.
This is easy to do using a keymap, for example. But let's assume that I
also search frequently using the same pattern preceded by an arbitrary
char *AND* followed by the same char. The char varies from search to
search.

    In Perl I would store the complex pattern in some scalar, but I
don't know how to do it in VimL. Probably it can be done with "let" and
"eval", but it won't work for syntax highlighting, AFAIC.

    Moreover, if I'm writing a syntax file and have a lot of syntax
items that contains the same complex pattern preceded and followed by a
character (this is only an example), that's difficult to maintain
because each time I have to change the complex pattern I have to change
it everywhere. Please note that this cannot be fixed modifying the
pattern adding an whatever\? atom at the front and end of it, because
the "whatever" MUST be present at BOTH ends.

    For the syntax highlighting, using "contains" solves the issue, but
again, this doesn't work for searches.

    In the end, the problem is to be able to reuse a pattern, no matter
if in a search, substitute, syntax highlighting, etc. And not, "\z(\)"
is not a solution because it only works in "start=" in syntax regions.
Is there a way of storing a pattern and reusing it in searchs,
substitutions, syntax highlighting, etc?

    Thanks a lot in advance :)

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!

Reply via email to