The visualization of Vim

Source: Internet
Author: User

Reference Document: http://blog.csdn.net/ii1245712564/article/details/46960387

First, comb the key knowledge for easy access

V (small v): Enter visualization

V (large V): Enter visual line

Ctrl + V: Entering a visual block

There are also some related operations that can be done

Delete selected text

Modify selected text

Replace selected text

Insert before text is selected

Insert after text is selected

gu The selected area is converted to lowercase

gU Select area to uppercase

g~ Case-Sensitivity intermodulation

Indent one unit to the right

Indent one unit to the left

Note: After the operation is complete, ' ESC ' ends the operation or exits the visualization

There are three modes in which you can enter a related command switch, for example:

V (Enter character visualization) ——— V or ESC (exit)

V (Enter character visualization) ——— V (enter line visualization)

What is visualization: Just select an area and then do something on it, and remember that, unlike normal operations, a visualization is an operation on an entire block of selected areas, and sometimes more efficiently.

For visual operations, there are three basic modes:

Character text manipulation (v): selecting text by character

Line this operation (V): Select text lines by row

Block text manipulation (Ctrl + V): Selecting text as a block

Main differences between three modes of selection text

Here's the cursor.

Perform operation ' V ', enter character text operation, select down

If you execute ' V ', enter the line text operation and select down

If you execute ' Ctrl + V ', enter the block text operation and select

You can also move left or right

Identification of three modes (see lower left corner)

A. Character visualization

B. Line visualization

C. Block visualization

To give a few more examples:

A. Comment out the entire file

Action: ctrl+v--Select target Block-----(uppercase)--#--esc

B. Replace (replace the first four lines of XXX with ABC)

C. Change the case ABC--ABC

Gu uppercase--lowercase

Gu lowercase--uppercase

Note: When selecting a block, O can change the extension direction

In general, sometimes it's a good idea to use visualizations.

The visualization of 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.