Vi/Vim
Picture copyright: lampbrother
Note: After Entering Vim/Vi, the command mode is used by default.
1) Basic commands
AAdd text behind the cursor
IInsert text before the cursor
: WqSave changes and exit
ZZShortcut Key, save the modification and exit
: Q!Exit Without saving changes
: WSave changes
2) basic operations
UCancel the previous operation
Ctrl + r Restore the Undo operation in the previous step
: Set nuSet row number
: Set nonuCancel row number
GgTo the first line
GTo the last line
: NTo row n
Clear Screen
A. First, execute gg to jump to the first line of the file.
B. Run the following command: dG.
3) Advanced Operations
Start split screen
A.Use uppercase O parameters for Vertical Split screen
$ Vim-On file1file2...
B.Use lower-case o parameters for horizontal split screen
$ Vim-on file1file2...
Note:N is a number, indicating the number of split screens
C.To switch between screens, just press ctrl + w.