Search for text of register in function
- by dotancohen
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.