Using the mouse in vim

Source: Internet
Author: User

1 Introduction Clevercode recently in using Vim's mouse mode. This section describes how to use the mouse in a terminal or terminal window.


2 Turn on the mouse

: Set Mouse=a



Tlist, double-click the function name. To view the contents of the function.

: Tlist



3 mouse off: Set mouse-=a


4 The character of the mouse mode ' mouse ' option determines when Vim uses the mouse:
n Normal Mode
V Visual mode
I insert mode
C command-line mode
h in the Help file, all of the above patterns
A above all the patterns
R Skip |hit-enter| Tips
A automatic selection in visual mode


The default value for ' mouse ' is null, which means that the mouse is not used. Usually you will use:
: Set Mouse=a
To start using the mouse (this is equivalent to setting ' mouse ' to "Nvich"). If you only want to be in several modes or
To use a mouse on two tasks, you need to focus on the letters that correspond to those patterns. For example:
: Set MOUSE=NV
will allow the mouse to work in normal mode and visual mode.
: Set Mouse=h
will make the mouse only work in the Help file (so that you can use "g<leftmouse>" to tag jump).


Whether the mouse can start in either Visual mode or select mode depends on the "selectmode" option package does not include
"Mouse".



5 fix Mouse Mode right button cannot paste problem with mouse and visual mode copy/paste (' mouse ' option must be set, see above):
1. Press the left mouse button on the first character of the text, move the mouse to the last letter of the text, and then release the left
Key. This will start the visual mode and highlight the selection area.
2. Press "Y" to extract the visible text into the nameless register.
3. Press the left mouse button at the location you want to insert.
4. Press the middle mouse button (scroll wheel).

Using the mouse in vim

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.