Thursday, July 15, 2010

Re: redir global

On Jul 15, 9:13 am, Bee <200...@calcentral.com> wrote:
> redir global
>
> :v/^127/
>
> Will show all lines that do not start with 127
>
> When I do:
>
> redir >not127.txt | silent v/^127/ | redir end
>
> Only the first line is save to the file.
>
> How to get all lines?

ok... I found something that works

function! NotHere(pat)
redir! >nothere.txt
execute "silent v/" . a:pat . "/"
redir end
endfunction

In the file to be searched:

:call NotHere("^127")

-Bill

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

No comments: