![]() In this case you can :set clipboard=unnamed or :set clipboard=unnamedplus to make all yanking/deleting operations automatically copy to the system clipboard. You also may want to have a look at the 'clipboard' option described in :help cb. For example, you could put vnoremap "*y in your ~/.vimrc so that you can visually select and press Ctrl+ c to yank to your system's clipboard. You might like to remap this to something more convenient for you. ![]() Assuming you have the appropriate compile options, one or the other should work. If all that went over your head, try using "*yy or "+yy to copy a line to your system's clipboard. See :help x11-selection for more details, but basically the "* is analogous to X11's _PRIMARY_ selection (which usually copies things you select with the mouse and pastes with the middle mouse button) and "+ is analogous to X11's _CLIPBOARD_ selection (which is the clipboard proper). On X11 systems both registers can be used. For instance, on systems that don't use X11 like OSX or Windows, the "* register is used to read and write to the system clipboard. ![]() Depending on your system, they may do different things. The "* and "+ registers are for the system's clipboard ( :help registers). Some linux distros supply a minimal vim installation by default, but if you install the vim-gtk or vim-gtk3 package you can get the extra features nonetheless. In this case, vim is not compiled with the +clipboard feature and you'll have to install a different version or recompile it. Be aware that copying/pasting from the system clipboard will not work if :echo has('clipboard') returns 0.
0 Comments
Leave a Reply. |