Analysis of Operating modes of Linux vi

Source: Internet
Author: User


The vi editor has three basic working modes: Command mode, text input mode, and last line mode. 1. Command Line Mode: This mode is the default mode after entering the vi editor. At any time, regardless of the user's mode, press the ESC key to enter the command mode. In this mode, you can enter the vi command to manage your own documents. In this case, any character entered on the keyboard is interpreted as an editing command. If the entered character is a valid vi command, the vi completes the corresponding action after receiving the USER command. Note that the entered command is not displayed on the screen. If the entered character is not a vi command, vi will ring an alarm. 2. text input mode: In command mode, Enter command I, attach command a, open command o, modify command c, replace command r, or replace command s to enter the text input mode. In this mode, any character entered by the user is protected by vi as the file content and displayed on the screen. If you want to return to command mode during text input, Press ESC. Www.2cto.com 3: Last Row mode: the last row mode is also called the ex escape mode. In command mode, you can press the ":" key to enter the last line mode. At this time, vi will display a ": "as the last line mode description, waiting for the user to enter the command. Most file management commands are executed in this mode (for example, writing the content in the editing buffer to a file is moderate ). After the last-line command is executed, vi automatically returns to the command mode. To switch from command mode to edit mode, type a or I. If you want to return data in text mode, Press ESC. In command mode, enter ":" to switch to the last line mode, and then enter the command. From xt_chaoji's column

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.