I want to have fast pasting while having :reg view. I have remapping:

:noremap <C-r><C-r> <ESC>:reg<CR>

While i am in this mode I want to to have single keystroke(buffer name) option like: ", 1, 2, 3, *, #, /, etc.. to paste register.

How to do that?

2 Answers 2


Try this...

:nnoremap <C-r><C-r> :reg<CR>:let regname = input("Register? ") \| exe 'norm "' . regname . 'p'<CR>

You'll see the :reg output and then a prompt. At the prompt enter the register (#, a, @, etc.) and hit Enter. The contents of the selected register will be pasted right after the current position of the cursor.

This is adapted from an answer I gave to a similar question about acting on the output of the [I command.

Fortunately, :reg enters the same general "what now?" prompt as [I does. That prompt allows : as a response and that puts us on the regular command line without dismissing the previous command's output. From there it's just a matter of displaying a prompt and then building a :normal command that pastes whatever register the user entered.

Update: Sounds like OP is interested in a variation that doesn't require hitting Enter. This should do it:

:nnoremap <C-r><C-r> :reg<CR>:echom "Register? "\|let n=nr2char(getchar())\|exe 'norm "'.n.'p'\|redraw<CR>

Besides using nr2char(getchar()) to get the register name I tacked a :redraw onto the end to eliminate the Press Enter or type command to continue prompt that blocks immediate return to Normal mode.

(FYI it's also shortened/compressed a bit compared to the first one.)

  • that is a very good answer. :) One remark: because register is a single character, process can be optimize by elimination of enter hittig at the end if it is possible...
    – lluke
    Jan 28, 2019 at 7:20
  • that's nice solution. Do you know how to force Vim to display :reg window in vertical split?
    – lluke
    Jan 28, 2019 at 13:33
  • I'm not aware of any native way to do that. Windows hold buffers while the :reg output is an extension of the command line and that's "global"; it'll display in the same place regardless of what window/buffer is current. I could probably make something like that work with a fair amount of scripting. I'm not volunteering, though. :)
    – B Layer
    Jan 29, 2019 at 10:36

I’ve not used it myself, but peekaboo provides a sort of HUD for pasting.

It’s not a “quick-paste” as you describe but may solve the same problem.

  • Actually it is quite fast in insert mode: <C-r> and register number hit
    – lluke
    Jan 28, 2019 at 12:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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