Stack Exchange network consists of 177 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.
I tried let @q = '<return>' and it obviously won't work
let @q = '<return>'
<return> is not completely wrong. You just need to use double-quote and add backslash. For example:
:let @q = "ihello\<Return>vim\<Esc>"
Required, but never shown