Re: Is there a variable containing all tokens that matched a regex search term?

2010-04-10 Thread Adam
On Sat, Apr 10, 2010 at 05:14, John Beckett wrote: > Adam wrote: > > I found this function (CopyMatches) online a while ago from > > here: > > http://vim.wikia.com/wiki/Copy_the_search_results_into_clipboard > > You reminded me that I have enhanced that script to behave more > usefully. It now de

Re: Is there a variable containing all tokens that matched a regex search term?

2010-04-10 Thread Christian Brabandt
Hi Antony! On Sa, 10 Apr 2010, Antony Scriven wrote: > That's not what the OP asked for. --Antony Sorry, I misunderstood. regards, Christian -- 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, vis

Re: Is there a variable containing all tokens that matched a regex search term?

2010-04-10 Thread Antony Scriven
On 10 April 2010 12:29, Christian Brabandt wrote: > Hi tomPorter! > > On Fr, 09 Apr 2010, tomPorter wrote: > > Is there a way to create a new window and populate it > > with only the found items? You snipped the rest of the specification. > I would do it like this, which means > :redir =>

Re: Is there a variable containing all tokens that matched a regex search term?

2010-04-10 Thread Christian Brabandt
Hi tomPorter! On Fr, 09 Apr 2010, tomPorter wrote: > Is there a way to create a new window and populate it with only the > found items? I would do it like this, which means :redir => a " redirect output into variable a :g/&&/ " print all lines matching the pattern &

RE: Is there a variable containing all tokens that matched a regex search term?

2010-04-10 Thread John Beckett
Adam wrote: > I found this function (CopyMatches) online a while ago from > here: > http://vim.wikia.com/wiki/Copy_the_search_results_into_clipboard You reminded me that I have enhanced that script to behave more usefully. It now defaults to copying from the whole file, and copying to the clipboar

Re: Is there a variable containing all tokens that matched a regex search term?

2010-04-09 Thread Adam
On Fri, Apr 9, 2010 at 16:25, tomPorter wrote: > OR is there a variable that contains all items matching the regex > search term > I found this function (CopyMatches) online a while ago from here: http://vim.wikia.com/wiki/Copy_the_search_results_into_clipboard. Just follow the instructions and

Re: Is there a variable containing all tokens that matched a regex search term?

2010-04-09 Thread Tony Mechelynck
On 09/04/10 23:25, tomPorter wrote: If I enter a regex search term, all occurrences of the matched items in a window will be highlighted. Is there a way to create a new window and populate it with only the found items? OR is there a variable that contains all items matching the regex search ter

Re: Is there a variable containing all tokens that matched a regex search term?

2010-04-09 Thread Tim Chase
On 04/09/2010 04:47 PM, Antony Scriven wrote: For a quick a quick hack, try this. :let tokens=[] :%s/&&\S\+/\=add(tokens,submatch(0))/g :undo :new :put=tokens I like it :) As a quick abuse of add(), the :undo can be obviated by making it :let tokens=[] :%s/&&\S\+./\=a

Re: Is there a variable containing all tokens that matched a regex search term?

2010-04-09 Thread Antony Scriven
On 9 April 2010 22:25, tomPorter wrote: > If I enter a regex search term, all occurrences of the > matched items in a window will be highlighted. > > Is there a way to create a new window and populate it > with only the found items? > > OR is there a variable that contains all items matchin

Re: Is there a variable containing all tokens that matched a regex search term?

2010-04-09 Thread Tim Chase
On 04/09/2010 04:25 PM, tomPorter wrote: Is there a way to create a new window and populate it with only the found items? not readily (no single-step solution), but it can be hacked. Start by cloning the document into a file you can rip up...either: :%y " yank the whole document :ne

Is there a variable containing all tokens that matched a regex search term?

2010-04-09 Thread tomPorter
If I enter a regex search term, all occurrences of the matched items in a window will be highlighted. Is there a way to create a new window and populate it with only the found items? OR is there a variable that contains all items matching the regex search term? Example: A colleague is working o