Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy/Paste from/to clipboard in vim stopped working [duplicate]

Tags:

vim

The problem is that copy/paste from/to vim to the clipboard stopped working. I'm not sure why...

In :reg I don't see the + and * buffers too...

Here's my .vimrc, if needed.

Any suggestions?

Thanks!

like image 410
brslv Avatar asked Mar 11 '23 14:03

brslv


1 Answers

OK, I figured it out. The problem was I was using the system vim (the one, preinstalled on my Mac). I've find it out with: which vim. It returned /usr/bin/vim. The problem with the default vim is that it's not compiled with the clipboard option (run vim --version | grep clipboard and if you see -clipboard, it means you don't have the "copy/paste to/from clipboard functionality).

Now, if you don't have vim installed with the homebrew, install it. Than, in your .zshrc (or .bashrc) file, provide the path to the /usr/local/bin file, so that it overrides the /usr/bin (before it). Now you're using the homebrew's vim, which comes with the +clipboard option enabled.

Have fun copy-pasting. :)

like image 88
brslv Avatar answered Apr 09 '23 19:04

brslv