VI since its inception, after continuous innovation, now Yun version of VI has a very powerful function, so that users can more easily and conveniently use it.
8.8.1 VI Working mode
Command mode
In command mode when entering VI, press <ESC> to return to command mode if already in insert mode or last line mode. In this mode, you can only use the key command, you cannot enter text.
Insert mode
Insert mode is to insert text into the file you want to edit, and the insertion position varies according to the command you are using. Entering insert mode from command mode requires typing I, a, O, R, and I, A, O, R, and so on. After you finish entering text, you must return to command mode with the <ESC> key.
Last line mode
The last line mode is named after the command appears on the bottom line of the Yun screen. In the command mode, type some special characters, such as/、?、:, and so on, the cursor jumps to the end of the screen and displays the last line of characters typed, when you type the command to enter, VI will display a certain response information as needed in the last line, and will automatically return to the command state.
8.8.2 vi Edit File basic process
At the command line, type VI testfile, where testfile represents the name of the file you want to open, and if the file does not exist, VI automatically creates a new file named Testfile.
Enter VI, press I into the insert mode, you can write the file, the cursor can be moved by the arrow keys. <BackSpace> button to delete the previous character.
If you have written a file, you can press <ESC> back to command mode, and then use: W Archive (note, is the colon command), at this time will not leave VI, to leave can press: Q, can also be combined with: Wq, on behalf of the preservation of leaving.
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.