Vim common copy and Paste commands

Source: Internet
Author: User

The usual copy and paste commands for VIM are organized as follows:

1. Select the text. Using V to enter the visual mode, move the cursor key selection.

2. The command to copy is: Y, the commonly used commands are as follows:
Y Copies the selected block to the buffer when a piece is selected using the V mode;
yy copy entire row (Nyy or yny, copy n rows, n is number);
y^ Copy the contents of the current to the wardrobe;
y$ Copy the contents of the current to the end of the line;
YW copy a word (NYW or ynw, copy n word,n to numbers);
YG Copy to end of file (NYG or yng, copy to Nth line, e.g. 1yG or y1g, copy to end of file)

3. The Cut command is: D, the commonly used commands are as follows:
D Cut the selected block into the buffer;
DD Cut Whole row
d^ cut to the beginning of the line
d$ cut to end of line
DW cuts a word
DG cut to the end of the gear

4. The command to paste is: p, the commonly used commands are as follows:
P lowercase p represents the post to the cursor (bottom), because the cursor is at the position of the specific character, so it is actually behind the character
P Capital P represents the front of the cursor (top)



5. The command to undo the operation is:
U: Undo operation,
U: Undo all Recent changes to a row
Ctrl+r: Redo Undo Operation

Vim common copy and Paste commands

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.