0

I've read this How to make vim paste from (and copy to) system's clipboard? and I know what the hotkeys are. But I'm unable to execute any of those commands. For example, what exactly should I press to call "* or "+? In which mode also? I've tried different things and none of them worked.

Community
  • 1
  • 1
Torito
  • 305
  • 1
  • 11

1 Answers1

1
  1. I am assuming you've double-checked that :echo has('clipboard') returns 1. If it returns 0, you're out of luck since vim isn't compiled with access to the system clipboard.

  2. If you have clipboard powers, then yanking and pasting inside of vim is done with pressing just the letter y and the letter p, in normal mode. Start doing this first, to confirm that you can yank and paste inside of vim. For instance, yank a line: yy and paste it p.

  3. Next, confirm that you can yank inside of vim to the system clipboard with "*y. (That means pressing the double-quote (shift-'), then an asterix (shift-8), then the letter y, all in quick-ish succession. Toggle over to another app and paste with the regular control-V. (You may be able to look at the bottom left of status line to see what you are literally typing, which might help).

  4. If that works, then the clipboard functionality is "good to go." If it doesn't you might need to tweak your .vimrc to get things working. Try setting the clipboard to unnamed: set clipboard=unnamed and retest step 3 again.

gregory
  • 10,969
  • 2
  • 30
  • 42
  • 1. -- what to do if it's 0? – Torito Feb 02 '17 at 07:51
  • "In this case, vim is not compiled with the +clipboard feature and you'll have to install a different version or recompile it." Note: I am quoting from the answer in "How to make vim paste from (and copy to) system's clipboard?" where this is already spelled out. – gregory Feb 02 '17 at 07:54
  • aaahhhhhhhhhaaaaaaaaaaaa – Torito Feb 02 '17 at 08:00
  • @Torito, Yep, it is a pain... and, this won't the last time this issue rears it head: yanking and pasting in/out of vim is always more of a hassle than it should be; so fasten your seat belt. – gregory Feb 02 '17 at 08:06