coolesting
coolesting

Reputation: 1451

The vimrc setting and the command of coping clipboard is conflicting

Vim version is 7.2.411, operating system is CentOS 6.

By default, i can use the mouse to select the text and click right key, then copy the selection to clipboard.

Now i want to use this option set mouse=a that i set it in ~/.vimrc file, but the previous operation is not working. Whatever i try "+y or "*y, still not works.

I just want to use the function that copys the yand text to clipboard, simultaneously, and the set mouse=a to be set in .vimrc file.

Upvotes: 3

Views: 343

Answers (2)

Dan Hulme
Dan Hulme

Reputation: 15280

From your description it sounds like you're using Vim in a terminal. By default, the terminal is handling the mouse clicks, so it's the terminal selecting and copying the text. When you set mouse=a, Vim handles the mouse itself, so selecting doesn't copy to the clipboard.

If the version of Vim you're using was compiled without X11 support, you can't copy and paste from inside Vim. This would explain why "+y and "*y don't work. You should try to install a "full" Vim version using your distribution's package manager. Be sure to run vim and not vi from the command-line, to get the proper version.

In this case, you can still let the terminal handle mouse-clicks (instead of Vim) by holding shift when you click or drag. This way, you'll get the behaviour you had previously had before you set mouse=a.

Upvotes: 0

Rook
Rook

Reputation: 62528

Check whether you have set clipboard=autoselect,autoselectml and set guioptions+=a set (you'll probably have some other "letters" in there as well)? The a is related to copying to the cliboard. The mouse=a only enables you to use the mouse in all modes.

Upvotes: 2

Related Questions