Is there a way in Vim to paste the search register on the command-line, but without the surrounding \<
brackets \>
? I often find myself doing a search in a buffer, and then wanting to use the matched pattern as an argument to grep
(more specifically, ack.vim).
Here's what happens if you search for foo
and then enter :Ack '<C-r>/
':
:Ack '\<foo\>'
This will fail to find anything. What I want instead is:
:Ack 'foo'
This is of course a simplistic example. Where this would be more valuable is with more complex search results.
I am aware of <C-r><C-w>
and <C-r><C-a>
for pasting the word/WORD under the cursor, and these often suffice, but not always.