Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am writing a VIM function which should search for the text found in register a. In VIM I would start a search with / then press Ctrlr and finish off with a then Return. However this line in the function is not working:

execute "/<c-r>a<Return>"

It is throwing this error:

E486: Pattern not found: <c-r>a<Return>

How do I enter the literal Ctrlr into the function? Thanks.

share|improve this question
up vote 1 down vote accepted

Use execute "call search('".@a."')" instead.

A bit of context for your question would be good, too.

share|improve this answer
Great, thank you! – dotancohen Sep 20 '12 at 11:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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