Vim Simple Command

Source: Internet
Author: User

1. Select chunks, replace or delete

Press v First, enter the visual editing state, select the replacement area, then CTRL + V, and then press C to remove the selected area.

2. Delete by line or by word

d$: Removes all characters from the position of the cursor to the end of the line.

D0: Deletes the position of the cursor to all characters at the beginning of the line.

DD: Deletes the entire row where the cursor is located.

NDD: Deletes the row of rows where the cursor is down n rows.

D1G: Deletes the character of the line to the first line of the cursor.

DG: Removes the character from the line to the last row of the cursor.

3. Mobile

GG: Move to the first line.

G: Move to the last line.

H,j,k,l: Up or down

4. Copying

YY: The line where the cursor is copied.

NYY: Copy cursor line to N-1 line, total n rows.

Y1G: Copies all data from the row to the first row of the cursor.

YG: Copies the data from the row to the last row of the cursor.

Y0: Copies all data from the character of the cursor to the beginning of the line.

y$: Copies all data from the character of the cursor to the end of the line.

5. Recovery and repeat operations:

U: Restores the previous action.

Ctrl+r: Repeat the previous action.

6. Paste

P: Paste to the right or bottom

P (Uppercase): Paste to left or top

Vim Simple Command

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.