Use of VI Editor on Linux

Source: Internet
Author: User

(1) VI is used in three ways

command line mode text mode last line mode


(2) command line mode can copy, delete, paste, insert, undo operation

Copy command:

<1> yy | YG indicates the line where the cursor is copied

<2> Nyy (parameter n means copying a few lines)

<3>ygg copy from cursor line to first line


Paste command:

<1> p means paste


Delete command:

<1>DG | DD Delete a row

<2> ndd (parameter n means to delete several rows)

<3>DGG Delete cursor line to first line

<4> x means delete one character


Insert command:

<1> o means jump to the next line where the cursor is inserted

<2> O means jump to the previous line where the cursor is inserted

<3> A indicates the entry starts from the next position of the character in the cursor

<4> A Indicates the entry starts at the end of the line where the cursor is located

<5> I indicates the entry starts at the previous position where the cursor is located.

<6> I indicates input from the beginning of the cursor


Undo command:

<1> u means undo last time

<2> u means to revoke all


(3) The last line mode can be saved, manipulated, replaced operation

Save command:










Use of VI Editor on Linux

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.