How to retrieve the currently searched for text in vim?

Posted by Paul Wicks on Stack Overflow See other posts from Stack Overflow or by Paul Wicks
Published on 2010-04-29T16:44:34Z Indexed on 2010/04/29 16:47 UTC
Read the original article Hit count: 224

Filed under:
|

For example, I have some code and I use "*" to search for something within that code. Not finding what I want in that file, I'd like to use something like ack or grep to search for it within the local directory. I know I can do :! ack whatever to do the search from within vim, but what I'd like to know is is there a way to replace whatever with the currently searched for word within vim.

© Stack Overflow or respective owner

Related posts about vim

Related posts about vi