Excerpts from Yue Wu's message of Mon Jan 10 12:21:30 +0100 2011:
> Hi, list,
> 
> I'm writing a vim script, in which I want to support buffer defined
> vars in two patterns, say, user can put the following lines into a
> file:
> 
>     a = [[1:"foo"],[2:"bar"]]

The most simple way is:

call map(filter(getlines(0,line('$')), 'match your var assignment here v:val =~ 
'regex'"), 'eval(v:val)')
(untested)

or the like. However be careful: eval can run arbitrary code. I don't
know about a "safe" way to do this without writing a parser or looking
for an existing one.
 
Marc Weber

-- 
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

Reply via email to