Say I've yanked the text "foo" into register x. How can I search my file for the contents of that register?

I know that I can type / to search, then Control+R followed by x to paste the contents of that register, leaving me with /foo. But I'm trying to use the name of the register instead.

For example, I tried /@a, but that doesn't work.

link|improve this question

62% accept rate
feedback

1 Answer

That's basically the easiest way to do it. If you want to script it, you could use something like this:

:execute '/' . @x
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.