Linux VI Editor

Source: Internet
Author: User

All Unix like systems will be built into the VI document editor, and other document editors will not necessarily exist.

But at the moment we use more of the Vim editor.

Vim has the ability to edit the program, can be active in font color to identify the correctness of the grammar, convenient programming.

Use Vi/vim to enter general mode

If you want to use VI to create a file named Hello.java, you can do this:

Press I to enter edit mode to start editing text

In the general mode, just press I, O, a and other characters can enter the editing mode!

In edit mode, you can find the –insert-in the status bar in the lower left corner, which is the hint that you can enter any character.

At this point, the keyboard, in addition to the [ESC] button, the other keys can be regarded as the general input button, so you can make any edits.

Press the [ESC] button back to normal mode

Well, assuming I've given him an edit in the style above, how do I get out? Yes! That's right! Just press the [ESC] button for him! Immediately you will find the –insert– in the lower left corner of the screen is missing!

In general mode, press: Wq after storage leave VI

OK, we want to archive, save and leave the command is very simple, enter ": Wq" can be saved away!

: Wq

Ok! This allows us to successfully create a test.txt file. is not very simple.

View Create File

LS can see all the files in the current directory (LS-L) can clearly see the properties of the file

Ls
Ls-l

If you want to open the code again and modify it, you can open it just as you would create it, and then you can edit it.

VI Hello.java

Linux VI Editor

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.