wasavi icon indicating copy to clipboard operation
wasavi copied to clipboard

Insert mode mapping for clipboard paste

Open HaleTom opened this issue 7 years ago • 7 comments

I'd really like to have Ctrl-V work for pasting from the clipboard in insert mode.

Having to press:

  1. Escape
  2. "*p
  3. a

is tedious.

How do I create an insert mode mapping for Ctrl-V?

HaleTom avatar May 29 '17 02:05 HaleTom

I tried to use:

map! <C-V> <esc>"*pa

But pasting inserts a newline, the pasted text, then another newline. Perhaps this is related to #163... or am I doing it wrong?

HaleTom avatar May 29 '17 02:05 HaleTom

wasavi can paste register contents by pressing Ctrl+R <register name> in input mode. So Ctrl+R * pastes clipboard contents. It is the same as vim!

akahuku avatar Jul 08 '17 07:07 akahuku

@akahuku You're correct, although what's also possible in normal Vim is to use the system clipboard as the default register, which gives you yank (y) and paste (p) "integrated" with the desktop environment, which in turn is very nice :) And I use that, but I'm aware that some people don't prefer it.

So would putting set clipboard=unnamedplus in wasavi do anything? Is that feature implemented?

Cause it would make this plugin (I'm just starting to use it) be very cool. But even now it's cool. Hell, I'm writing this note in it :D Together with Vimium they're almost perfect.

butla avatar Aug 06 '18 20:08 butla

Ist there a known way to get <C-v> or <C-V> to work?

andys8 avatar Jul 04 '19 09:07 andys8

You can now just use map! <c-v> <c-r>*

RGD2 avatar Sep 20 '21 09:09 RGD2

Although I don't recommend it - it means you won't be able to insert utf-8 characters with <c-v>u, since you'll cover over the special insert mode.

RGD2 avatar Sep 20 '21 09:09 RGD2

RGD2: I mapped to <c-V> (ctrl + shift + v) and that worked great and doesn't interfere with the native behavior.

mmikowski avatar Jun 28 '23 01:06 mmikowski