Vim: Capturing search results

May 27, 2011 at 10:57 am | Posted in Oracle Developement | Leave a comment

You can capture the search results from the :g/ command in Vim into a register for later use:

:redir @a                   --capture search results in register a
:g/my search string         --execute search
:redir END                  --turn off capture
:new                        --create a new document
:put! a                     --paste contents of register a into new document
Advertisements

Leave a Comment »

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.
Entries and comments feeds.

%d bloggers like this: