In Linux VI, activate the middle mouse button to implement rolling line feed.

Source: Internet
Author: User
First, write a summary. The following conditions are required. gpm_mouse support is enabled during the first Vim compilation, and GPM service is installed in the second system.

-----------------------------------------
Run the following command to open the mouse:
: Set mouse =
Otherwise, VIM will not recognize the mouse in all modes (see 'mouse ').

Currently, the mouse only in UNIX xterm window, Linux terminal (with GPM | GPM-mouse |), MS-DOS
And windows. Click the mouse button to position the cursor, set the area, and paste it.

The character of the 'mouse 'option determines where Vim uses the mouse:
N Normal Mode
V visual mode
I insert mode
C Command Line Mode
H In the Help file, all the above modes
All models above
R skip | hit-enter | prompt
A is automatically selected in visual mode.

The default value of 'mouse 'is null, that is, no mouse is used. You usually use:
: Set mouse =
To start using the mouse (this is equivalent to setting 'mouse 'to "nvich "). If you only want
When you use the mouse over two tasks, you need to focus on the letters corresponding to those modes. For example:
: Set mouse = NV
The mouse will work in normal and visual modes.
: Set mouse = H
The mouse will only work in the Help File (in this way, you can use "G <leftmouse>" for tag jump ).

Whether or not the mouse can start to be selected in visual mode or select mode depends on the option package "selectmode" does not include
"Mouse ".
___________________________

The GPM mouse is valid only when it is enabled during compilation | + mouse_gpm |. GPM mouse driver (Linux terminal) Not
Supports four-click attacks.

Insert mode, but at the beginning, VIM is now back to normal mode. When the visual or select mode ends
To the insert mode. This is similar to using a CTRL-O in insert mode. Select mode in 'selectmode'

When the item contains "Mouse", it is used.

Scroll wheel, right? We wantProgramHe also needs to scroll down.

You don't have to press Ctrl-F/Ctrl-B!

If you like to use Vim to edit files in xterm as I do, you will be very fascinated by using scroll mouse in Vim. The tips in this article can help you realize this dream.

You needCodeAdd ~ /. Xdefaults file:

Xterm * vt100.translations: # override "N"

: String ("0x9b") string ("[64 ~ ")" N"

: String ("0x9b") string ("[65 ~ ")" N"

: String ("0x9b") string ("[62 ~ ")" N"

: String ("0x9b") string ("[63 ~ ")" N"

: "N"

:

Then, modify the vimrc file to create a ing for the above binding:

Map [62 ~

Map! [62 ~

Map [63 ~

Map! [63 ~

Map [64 ~

Map! [64 ~

Map [65 ~

Map! [65 ~

Now we can use the scroll wheel to roll the vim screen.

Forget Ctrl-F and Ctrl-B.

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.