Get the App
SLTechnology News&Howtos  ›  Servers  › 

How does linux exit editing mode

Shulou Source: shulou.com Published: 2022-06-03 03:36:40 11月08日 Update

Background

Editors in text mode include vi and vim (an enhanced version of vi). Vi and vim are our most commonly used editors in Linux. Vi or vim is the most basic text editing tool of Linux. Although v or vim is not as simple as the mouse click operation of the graphical interface editor, the vi editor can never be compared with the graphical interface editor in the system management and server management character interface. (note: vi is the most classic text editor in the unix/linux operating system, which can only edit characters, not fonts and paragraphs; it can either create or edit files; it has no menu, only commands, and many commands. Although vi operates very differently from other commonly used text editors such as gedit, it is still used frequently because it runs in a character interface and can be used in all unix/linux environments. )

There are three modes of vim, note: there are many different names for these three modes, which I call it here according to Brother Bird's linux book.

General instruction mode, edit mode, instruction line command mode

The 1.vim file name enters the general mode

two。 Press I to enter edit mode; (or I, o, O, a, A, r, R)

3. When editing is over, press ESC to jump to normal mode

4. Press: enter instruction line command mode

The command after entering instruction line mode is as follows

1. Save without exiting:

: W save the file without exiting vi editing

: w! Force save without exiting vi editing

W file saves the changes to file and does not exit vi editing

two。 Save and exit:

Wq saves the file and exits vi editing

: wq! Force to save the file and exit vi editing

3. Do not save and exit:

: Q do not save the file and exit vi editing

: q! Do not save the file and force to exit vi editing

: e! Discard all changes and edit since the last time the file was saved

These are the details of the command for linux to exit editing mode. Please follow other related articles for more information.

Tags: Mode file editor command instruction text interface character compulsion name graphics common use system management different same various operating system content only Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Shulou Tech Info Xiaomi Shulou Technology Shulou Information