text Editing tools under the VI command line
Vim is an enhanced version of VI
command vim to start the Vim editor
vim can typically be used in the form of a vim+ target file path
if the destination file exists, Vim opens the file
If the destination file does not exist, create a new file
VI has three modes: Command mode, insert mode, and ex mode
any mode can go back to command mode with ESC key
Press "i" key in command mode to enter into insert mode, press ESC in insert mode to return to command mode
Press ":" in command mode to enter ex mode, which can be saved, modified, and exited in ex mode
Commands commonly used in command mode are as follows:
I insert text before the cursor
o Insert a new row below the current line
dd Delete entire row
u undo Last Action
yy copy Current line
N+yy First Press 5, followed by YY, is to copy 5 rows of content
p Paste
R replaces the current keyword
/Find Keywords
ex Mode
: W Save current changes
: Q Exit
: q! forced exit
: x Save and exit
: Setr number Displays line numbers
:! Execute a system command and display the results
: SH switch to command line, use Ctrl+d to switch back to vim
Linux basic Operations--vi and VIM