Question

I use pandoc markdown in text files and want to automate links that refer to internal textnodes. For example I have a link like [\%110lund] going to the word "und" in line 110. To automate the jumping process I defined a keybinding:

nnoremap <Leader>l vi[y/<ctrl+r>0<CR>

Unfortunately <ctrl+r> is written as the query string instead of performed to copy the visual selection.

So my question is how do I have to notate <ctrl+r>0 at this location so that it is actually performed instead of written out

Was it helpful?

Solution

Use c+r instead of ctrl+r.

In order to avoid confusion, I am striking out the incorrect edit that someone else made, rather than reverting it. In the context of a vim mapping (such as the :nnoremap of this question) the following should be typed literally. For example, <c-r> really means 5 characters.

Use <c-r> instead of <ctrl+r>.

See :help keycodes for more options.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top