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

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

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

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

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

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

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 matching

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=[]

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

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 tom.x.por...@gmail.com 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