Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can vim use the system clipboard(s) by default?

Tags:

vim

I am running into several problems because vim's tabs are, for the lack of a better term, god awful. I want to start using multiple Gnome tabs instead, each with a different instance of vim. Everything should work fine, however, only the system buffer + can be used to share text. This makes all the commands two key strokes longer:

y y becomes " + y y

y w becomes " + y w

d ' k becomes " + d ' k

This is especially so when one considers that a simply yank/paste operation like so

y y p

becomes

" + y y " + p

Is there anyway to instruct vim to always use the system clipboard(s)?

EDIT see Here for more information on using multiple instances of vim across Gnome Terminal Tabs

like image 538
puk Avatar asked Jan 06 '12 11:01

puk


People also ask

Can you paste from clipboard into vim?

When using Vim under Windows, the clipboard can be accessed with the following: In step 4, press Shift+Delete to cut or Ctrl+Insert to copy. In step 6, press Shift+Insert to paste.

How do I enable copy and paste in vim?

You can use :set mouse& in the vim command line to enable copy/paste of text selected using the mouse. You can then simply use the middle mouse button or shift insert to paste it.

How do I copy and paste in vim browser?

In Vim, Copying is done using the y or "yanking". To copy selected text to system clipboard type "+y in Normal Mode. Now you can paste it anywhere else using Ctrl-v .

How do I stop vim from Pasteing?

vim Inserting text Disable auto-indent to paste code Just press F3 in insert mode, and paste. Press F3 again to exit from the paste mode.


1 Answers

I found a solution to my problem here. If you add the following to your .vimrc file

set clipboard=unnamedplus 

Everything you yank in vim will go to the unnamed register, and vice versa.

like image 78
puk Avatar answered Sep 20 '22 15:09

puk