The normal mode of VIM basic learning

Source: Internet
Author: User

1. Operation = operator + action


AAA BBB
For example, D is the delete command, and B moves to the beginning of the string closest to the cursor
When we execute the DB, we remove the characters from the cursor (excluding the cursor position) to the beginning of the nearest string.
The DJ will delete the line with the cursor and the next line

2. A I text object


The so-called text object, plainly speaking, is actually specialized in manipulating the text
The difference between the two of them is
A-operating range includes boundary
I-operation range does not include boundary
such as AAA BBB CCC
When our cursor is at the second B, we execute the VIW and you will find the BBB highlighted. If you execute VAW
You will find the space behind the BBB will also be highlighted, if there is no CCC, the front space will be highlighted
For the string {AAA}, if you execute va{, then {AAA} will be highlighted; If you execute vi{, only AAA will highlight

3.<c-a> <C-x> digital Plus and minus


<c-a>-can achieve an increase in the next number
<c-x>-can achieve a reduction in the next number
They also support, adding the number N to the front of the command to achieve the effect of +n or-n

For example
Zhangshuli 28 19880123
The cursor is at the beginning and you execute
2<c-a>, then 28 will become 30.
And then you move the cursor to 1988 of 1,
Execute 23<c-x>, then 19880123 will become 19880100

4. ~ g~ gu gu case conversion action ~-+action-+ action-+ action-+ action-+ Action-You can implement an entire line of uppercase conversions



5. AP paragraph Commands


It can manipulate the entire paragraph
For example

AAA BBB CCC
AAA BBB CCC

The cursor is in the first line, and then we execute the DAP
You will find that you have deleted these two lines, including the following blank line
That is, it will take these two lines as a paragraph (should be separated by a blank line)

The normal mode of VIM basic learning

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.