Chapter V text Editor vi Command-centos7.5 knowledge
I. Editing the contents of the document
The role of a text editor
Create or modify a text file
Maintain various configuration files in Linux system
The most commonly used text editor in Linux
Vi: the default text editor for UNIX-like operating systems.
Vim:vim is an enhanced version of the vi text editor (commonly referred to as the vi editor)
Vi vim
Three working modes
Command mode, input mode, last line mode
Switching between different modes
I plug-in
A plus type
O Edit after inserting a new row
Basic operation of command mode
Cursor movement
Copy, paste, delete
File content lookup
Undo edits and save exit
The basic operation of the last line mode
Save the file and exit the vi editor
Open a new file or read the contents of another file
File content replacement
Dw deletes a word
Save exit:
: s/old/new/gc confirms replacement on the same line
:% s/old/new/gc
Assignment:
1. Copy-paste, move-paste, single-line search and replace, full-text search and replace exercises in VI