From: http://blog.sina.com.cn/s/blog_622d95080100ny94.html
In ~ /. After set mouse = A is added to vimrc, the right-click Vim cannot be copied. The solution is as follows:
Press and hold the Shift key, and then select. At this time, X processes the selection, and the copy option is enabled. If the Shift key is removed, VIM processes the selection.
Original article:
Modified ~ /. After the vimrc file, the right mouse cannot copy the text.
Found in the configuration file (~ /. Vimrc) found that there is such a paragraph:
11 "in your terminal emulators the mouse worksjust fine, thus enable it.
12 if has ('mouse ')
13 Set mouse =
14 endif
The Vim Help file contains the following explanations:
The mouse can be enabled for different modes:
N Normal Mode
V Visual Mode
I Insert mode
C Command-line mode
H All previous modes when editing a Help File
A All previous Modes
R For | hit-enter | and | more-Prompt | prompt
Normally you wocould enable the mouse in all four modes:
: Set mouse =
When the mouse is not enabled, the GUI will still use the mousefor
Modeless selection.This doesn' t move the textcursor.
So set mouse = A in the configuration file starts all the modes, and VIM takes over the control of the mouse.
The background knowledge involved is:
There are two Processing Methods for mouse events: Program processing and X processing.
If X is responsible for processing, it is left-click selection and paste in the middle.
There are two methods for X to handle in VIM:
1. Press shift and select. At this time, X processes the selection and the copy option is enabled. If the Shift key is removed, VIM processes the selection.
2. in. in vimrc, set mouse = (that is, clear) is set. At this time, VIM never interferes with the mouse selection, and always gives the processing permission to X. At this time, the mouse is in the stateless editing status, of course, you can also use the mouse to switch the tab window in Vim, and the editing cursor in VIM will not follow the mouse.