> That could be useful, though
> Select lines by pattern and write to a file(should exist):
>
> :!touch file
> :g/_pattern_/ .w >> file
It does exist, but not with :g -- here's a slightly modified variant of
the example I gave the OP. I think it does what you want.
:redir >> file
:ilist! /pattern/
:redir END
see
:help :redir
:help :ilist
:help [I
:help :search-args
For redir-with-append (>>) you don't need to !touch the file -- if it
doesn't exist, it will be created.
Best regards,
Tony.
--
Cunnilingus is next to godliness.
--
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
To unsubscribe, reply using "remove me" as the subject.
No comments:
Post a Comment