A practical, well remembered vim command

Source: Internet
Author: User
Tags lowercase

Command 1: [VYDC] [IA] [Pair_char]

The above command means that the command consists of three parts, each part of which can be any one of the characters inside []

The first section specifies the action type

The second and third sections specify "Scope of action," based on the position of the current cursor, which is very important

(1)

V:visual Select

Y:copy

D:delete

The difference between C:change and delete is that it will delete first and then enter "Insert Mode", which is equivalent to first D and then press I to enter "Insert Mode".

(2)

Pair_char can be pairs of characters, such as {[<] can also use their corresponding right-close version, such as}] and so on

Pair_char special case, can be a W, representing the cursor is the word (separated by a space), when the middle is using I or a, the difference is that the operation result package does not include the word right space

(3)

I:exclude the Pair_char

A:include the Pair_char

The difference between I and a is that the specified "action range" package does not include the pair of characters specified by Pair_char, that is {} or [] or () or "", and so on

Let's take an example:

Suppose there is a text behavior abcd "FGH Ijk <lmn>";

The cursor is at m (underlined)

vi< function: Selected LMN

ya " role: Copy the" FGH Ijk <lmn> "

di " function: Delete fgh Ijk <lmn>

ci< function: Delete lmn and enter "Insert Mode", the cursor is in the middle of <>

Command 2: [VYDC] [TF] [A_char]

(1)

See also the command 1 (1)

(2)

T:till, exclude the character ' A_char '

F:find, include the character ' A_char '

T and F represent from left to right

In addition, you can use uppercase T and F to represent the right to left

(3)

A_char: Represents a character, special case is 0 and $, representing the beginning and end of a line

Command 3: Uppercase and lowercase conversion gU, GU

(1)

[Visual_select_something_by_someway]gu

[Visual_select_something_by_someway]gu

Select a range of content in some way (you can choose from the v instruction in command 1,2) and convert it to uppercase or lowercase

(2)

GU [IA] [Pair_char]

Gu [ia] [Pair_char]

GU [TF] [A_char]

GU [TF] [A_char]

This is done by specifying the GU to be converted to uppercase, and then by specifying "scope of operation" in the latter two sections.

[IA] [Pair_char] See Interpretation of the command 1

Here the middle part uses I or a seems to be no different

[TF] [A_char] See Interpretation of the command 2

This column more highlights: http://www.bianceng.cnhttp://www.bianceng.cn/OS/Linux/

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.