VI Common Command Skills __ command

Source: Internet
Author: User
Tags file copy

The command technique in VI
File copy in the diffrent file:
"A9yy @don ' t forget", A is variable name,9 be copy lines, yy is copy
"AP @don ' t forget the", A is variable name,p is paste
YY @copy the current line
P @paste
DD @delete the current line
Nyy @copy N Lines
NDD @delete N Lines
D) @Delete the beginning of the next sentence
D} @Delete the beginning of the next paragraph

: Set nu @don ' t forget the:, Display line numbers
: Set Nonu @don ' t forget the:, Undisplay line numbers

Shift + G @jump to the last line
SHIFT + U @return last State
"^" Jump: Quickly jump the cursor to the line of the line at the beginning of the character;
"$" Jump: Quickly jump the cursor to the line trailing characters;

VI There is an order I add here: I was also a chance to find out, really good. When we use the YY command to copy in this file, you cannot copy it to another file, which is more convenient than using the Clipboard command.
Press Nyy in hello1.c to copy the text you want to copy, and then enter the command: E./hello2.c this is to jump to the hello2.c this file, and then press p can be pasted to the place you want to paste. (for text operations must be text is only saved state, E can be the root of the directory after the file)

If the actual effect is not very good please refer to the original: http://blog.csdn.net/qq_21792169/article/details/49893919

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.