I. Introduction of VIM
Vim is an upgraded version of VI (Vim config file in/ETC/VIMRC)
Vim is a color-display
Yum Install-y vim-enhanced
General mode, edit mode, command mode
Second, Vim color display and move the cursor
Vim View/etc/passwd file
vim/etc/passwd
passwd File Contents:
Three, the general mode of moving the cursor
Cursor Movement shortcut keys:
Press 5, then L or a space, and the cursor will move 5 characters to the right.
Press 6 and press H, the cursor will move 6 characters to the left
Press 8, then press J, and move the cursor down 8 lines
Press 9, then press K, the cursor moves up 9 lines
Ctrl+f: One graphic a screen to turn down
Ctrl+b: One graphic, one screen upwards
Press 0: The cursor moves quickly to the beginning of the line or shortcut: Shift+6 can also be moved quickly to the beginning of the line
SHIFT+4: Cursor moves quickly to the end of the line
Press two times G; cursor quickly back to the first line
SHIFT+G: Cursor moves quickly to the last line
Press 50 First, then press SHIFT+G: The cursor moves quickly to line 50th
Iv. copy and paste in general mode
Press two times D: delete/cut the row where the cursor is located
Press 5, then two d: delete 5 rows after the cursor row, and delete 5 rows down
P: Paste the copied or pasted content from the line where the cursor is located
Shift+p: Pastes content that has been copied or pasted, starting at the line where the cursor is located
U: Restore previous action (up to 50 restores)
Press two times y: the line where the cursor is copied
Press 3, then two y: Copy 3 lines from the cursor
Ctrl+r: Use U to restore the previous operation accidentally pressed the U, you can press Ctrl+r restore back
X: Remove one character backwards
Press 10 and then x: Remove 10 characters backwards
Shift+x: Delete a character forward
V: Start with the character of the cursor, press V, move the cursor to the specified character, and press X to make the copy. Paste and other operations
Vim introduces the various functions of VIM in general mode