Linux Basics 06_Vi Text Editor

VIM

  • The command vim can start the vim editor
  • Generally, we vim 目标文件路径use vim in the form of
  • If the target file exists, vim opens the file
  • If the target file does not exist, vim creates and opens the file

VIM mode

  • Command mode (regular mode): After vim starts, it enters the command mode by default, and you can return to the command mode by pressing the esc key in any mode (you can press it several times). In the command mode, you can complete selection, copy, paste, undo and other operations by typing different commands.
  • Insert mode: “i”Press the key to enter the insert mode. In the insert mode, you can input and edit text content, and use the esc key to return to the command mode.
  • ex mode: “:”press the key to enter ex mode, the cursor will move to the bottom, where you can save changes or exit vim.

command mode

command mode

insert mode

In the command mode, “i”press the key to enter the insert mode. In the insert mode, you can input and edit text content, and use the esc key to return to the command mode.

EX mode

EX mode

After starting the vim command and editing the document, I suddenly found that there is no name. You can use the: command to switch to ex mode and use the file command to name the text, such as:
:file filename.txt

Guess you like

Origin blog.csdn.net/Waldocsdn/article/details/105307798