Vim basic functions, modes, and commands 1. vim functions 1. run vim to start the vim editor. 2. generally, we use the vim + target file path to use vim3. if the target file exists, vim will open the file 4. if the target file does not exist, vim creates and opens the file. vim Mode 1. general mode, edit mode, Command Line Mode 2. the general mode and the edit mode and command line mode can be switched to each other, but the edit mode and command line mode cannot be switched to each other. III. in normal mode, run the command 1. I to insert text before the cursor. If you want to insert text, move the cursor there and press I to insert a new line under the current line 2.o 3. dd deletes the entire row. 4. yy put the content of the current row into the buffer (copy the current row) 5. n + yy put the content of n rows into the buffer (copy n rows) 6. p put the buffer text behind the cursor (paste) 7. u undo the previous operation 8. r replaces the current character (press r first and then press the target character) 9. /search for keywords (the keywords are highlighted and switched back and forth by n directly) 4. command Line Mode 1.: w Save the current modification 2.: q exit 3: q! Force exit 4.: x save and exit, equivalent to wq 5.: set number (set nu) display row number 6 .:! System Command to execute a system command and display the result 7. Switch sh to the command line