Use shortcut keys for Linux vim to delete, copy, paste

Source: Internet
Author: User

Delete

X Lowercase x indicates that one character is deleted backwards, that is, the character where the cursor is deleted

NX N represents a number, which means that each character is deleted backwards, for example: 10x means to delete the next 10 characters including the cursor

X-Large x indicates a character before the cursor is deleted, excluding the character of the cursor

NX N represents a number, which means that each character is deleted forward, for example: 10X means 10 characters before the cursor is deleted, excluding the character of the cursor


DD deletes the line where the cursor is located, and is actually cut

NDD N represents a number, removing the downward n-line of the cursor

D1G Delete the row of the cursor to the first row of data

DG Deletes the row of the cursor to the last row of data

D0 the first character of the line to which the cursor is located

d$ Delete the last character of the line where the cursor is located


YY the line where the cursor is copied

Nyy N Represents the number, and the next n line where the cursor is copied

y1g copy cursor line to first row of data

YG copy cursor row to last row of data

y0 copy cursor to the first character of the line

y$ copy cursor to the last character of the line


P Small p indicates that the copied data is pasted on the next line of the cursor

P Large p indicates that the copied data is pasted on the previous line of the cursor


J merges the row of the cursor with the data from the next row into one row


U small u means undo previous action (especially important, similar to crtl+y inside word inside windows)

Ctrl+r, in contrast to u, means redo the previous step (especially important, similar to the crtl+y in Word inside windows )


. Point , which means repeating the previous operation, example: Want to copy, always press this point on the line


Note: Delete, copy, and paste above are all actions in non-edit mode

Use shortcut keys for Linux vim to delete, copy, paste

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.