After vimrc enables the mouse, the vim right-click cannot be copied

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.