0

In vim I would like to create a key map for gp in normal mode so that it switches to insert mode and simulate the shift+insert key press and goes back to normal mode.

here is what I tried: nmap gp i<S-Insert><esc>

All it does is insert the text <S-Insert> instead of pressing executing shift+insert.

I've looked at Paste in insert mode? but the I can't get the contents of what I'm pasting from a buffer.

Patrick Forget
  • 2,143
  • 1
  • 18
  • 20

1 Answers1

1

You have to enter the control characters directly. You do this by pressing <C-V><Wanted Character> in insert mode.

For more on this see i_CTRL-V.

hgiesel
  • 5,430
  • 2
  • 29
  • 56