The selection is automatically placed on the X11 clipboard - VIM

In my previous installation of Linux, when I selected some text in visual mode (without a mouse!), It would automatically put it in its X11 clipboard. Then I could naturally paste this text to another location using the middle mouse button.

With my new Linux installation, this no longer works (just selecting the text in visual mode no longer fits the X11 clipboard).

How can I return this nice feature?

(I'm not interested in solutions "*yor "+ywhich, by the way, do not work on my system.)

Thanks in advance!

+5
source share
4 answers

The visual selection (v, V or CTRL-V) can be automatically copied to X11 Selection (* buffer).

non-gui ( if + xterm_clipboard vim -version). gui guioptions .

:

set clipboard+=autoselect
set guioptions+=a

:

set clipboard-=autoselect
set guioptions-=a

vim .:

help 'clipboard'

( )

+6

:

set guioptions+=a

GUI (Gvim). :help guioptions_a.

                        *guioptions_a* *'go-a'*
  'a'   Autoselect:  If present, then whenever VISUAL mode is started,
    or the Visual area extended, Vim tries to become the owner of
    the windowing system global selection.  This means that the
    Visually highlighted text is available for pasting into other
    applications as well as into Vim itself.  When the Visual mode
    ends, possibly due to an operation on the text, or when an
    application wants to paste the selection, the highlighted text
    is automatically yanked into the "* selection register.
    Thus the selection is still available for pasting into other
    applications after the VISUAL mode has ended.
        If not present, then Vim won't become the owner of the
    windowing system global selection unless explicitly told to
    by a yank or delete operation for the "* register.
    The same applies to the modeless selection.
+3

Vim gnome- Arch Gentoo Linux .

Vim Konsole .

gvim -v GVim, set guioptions+=a : , Vim, Linux.

,

+1

Debian vim-gnome.

pkg-vim-maintainers vim-gtk, vim-gnome, vim-lesstif.

0
source

All Articles