Saving/reusing (sub)patterns

2010-12-15 Thread BPJ
Is it possible in vimscript to save and reuse a (complex) (sub)pattern similar te Perl's qr// ? As usual I seem unable to find the right help section because of not knowing the right search term... /bpj -- You received this message from the vim_use maillist. Do not top-post! Type your reply

Re: Saving/reusing (sub)patterns

2010-12-15 Thread Tim Chase
Is it possible in vimscript to save and reuse a (complex) (sub)pattern similar te Perl's qr// ? While I don't know what Perl's qr// does (I'm more of a Python guy), you can certainly save complex patterns and reuse them: Save something recently searched: /complex_pattern_1 :let cp1=@/

Re: Saving/reusing (sub)patterns

2010-12-15 Thread ZyX
Reply to message «Saving/reusing (sub)patterns», sent 15:29:09 15 December 2010, Wednesday by BPJ: Vim patterns are normal strings. I do not know any way to save a compiled version, but you can use variables to construct a pattern. Here are some pieces of code from my YAML syntax file