Tuesday, January 26, 2010

Re: search for absent strings

Hi drlatex!

On Di, 26 Jan 2010, drlatex wrote:

> To see the result, I've tried
> :echo lst

What did it return? If it returned [] it means, all items were found in
your file.

Were those keywords by any chance in the same file (e.g. in the first
line?) Then I would have changed Tim's command like this:

let a=split(getline(1), '\s*,\s*')
for arg in a | if search(arg, 'Wn')>1 | call filter(a, 'v:val=~arg') | endif| endfor

(in case, all your keywords are in line 1. If they were in line 2
exchange both 1 by 2)

regards,
Christian

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

No comments: