Delete, copy, and paste linux vim shortcut keys

Source: Internet
Author: User

Delete, copy, and paste linux vim shortcut keys

Delete

In lowercase, x indicates that a character is deleted backward, that is, the character where the cursor is located is deleted.

Nx n indicates a number, indicating that each character is deleted backward. For example, 10x indicates that the last 10 characters including the cursor are deleted.

X in uppercase indicates that a character before the cursor is deleted, excluding the character where the cursor is located.

NX n indicates a number, indicating to delete each character forward. For example, 10X indicates to delete the first 10 characters before the cursor,Excluding the cursorCharacter


Dd deleting the row where the cursor is located is actually cutting

Ndd n indicates a number. Delete the n rows down the cursor.

D1G delete data from the row where the cursor is located to the first row

DG deletes the data from the row where the cursor is located to the last row

D0 deletes the first character from the row where the cursor is located

D $ Delete the last character from the row where the cursor is located


Yy copy the row where the cursor is located

Nyy n indicates a number. Copy the n rows down the cursor.

Y1G copy the data from the row where the cursor is located to the first row

YG copies the data from the row where the cursor is located to the last row.

Y0: copy the cursor to the first character of the row

Y $ copy the cursor to the last character of the row


P indicates that the copied data is pasted to the next row of the cursor.

P indicates that the copied data is pasted on the top line of the cursor.


J. Merge the row where the cursor is located with the data of the next row into one row.


U indicates detaching the previous operation (especially important, similar to crtl + y in word in windows)

Ctrl + r is opposite to u, which indicates redo the previous step (especially important, similar to crtl + y in word in windows)


.To repeat the previous operation. For example, if you want to copy multiple times, keep following thisPointThat's all.


Note:The deletion, copy, and paste operations are performed in non-editing mode.

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.