What are the operating modes of vim?

烟雨青岚
Release: 2020-06-29 15:19:58
Original
4063 people have browsed it

vim operation modes include: 1. Normal mode, used to browse and modify text content; 2. Insert mode, used to add content to text; 3. Visual mode, equivalent to highlighting selected text. Normal mode; 4. Command mode, used to operate text files (not the content of text files).

What are the operating modes of vim?

Vim’s modes

1. Vim common modes.

Command mode(command-mode)

Insert mode(insert-mode)

Visual mode(visual-mode)

Normal-mode

2. How to enter these modes

①.Normal mode

Normal mode is mainly used to browse and modify text content

Generally, Vim is opened in normal mode. In any mode, just press the Esc key to return to normal mode.

②.Insert mode

Insert mode is used to add content to text

i Start typing text before the character where the cursor is and enter Insert mode

a Start inputting text after the character where the cursor is and enter insert mode

o (letter o) Open a new line below the line where the cursor is to input text and enter insert mode

s Delete the character where the cursor is and enter insert mode

I Start inputting text at the beginning of the line and enter insert mode. The beginning of the line refers to the first non-whitespace character. If there is a space at the beginning of the line, enter text after the space and enter insert mode

A Start entering text at the end of the line and enter insert mode. This works great, you don't have to worry about where the cursor is on the line, just press A and it will be waiting for you to enter text at the end of the line.

O (capital letter O) Open a new line above the line where the cursor is located to enter text and enter insert mode.

S ​​Delete the line where the cursor is and enter insert mode

③Visual mode

Visual mode is equivalent to the normal mode after highlighting the selected text.

Visual mode has sub-modes, the visual row mode for selecting in row units, which is entered using the "V" key (that is, Shift v); and the visual mode for selecting in block units. Block mode, enter with "Ctrl v" key.

④Command mode

Command mode is mostly used to operate text files (rather than operating the contents of text files), such as saving files; or used to change the editor itself status, such as setting multi-column windows, labels or exiting the editor...

Recommended tutorial: "Linux Operation and Maintenance"

The above is the detailed content of What are the operating modes of vim?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template