Vim edit mode
- I enter edit mode from where the cursor is located
- I enter edit mode from the beginning of the cursor position
- O Enter edit mode from below the line where the cursor is located
- O Enter edit mode from the line where the cursor is located
- A from the location of the cursor to the next one into edit mode
- A enters edit mode at the end of the line where the cursor is located
Vim Command mode
- /word after the cursor looks for a string word, press N to go back to search
- ? Word finds a string before the cursor word, press N to continue searching
- : n1,n2s/word1/word2/g find word between n1-n2 rows and replace with Word2, without G replaces only the first word1 of each row
- : 1, $s/word1/word2/g replace all word1 in the document with Word2, and no G replaces only the first word1 of each row
- : W Save Text
- : Q Quit Vim
- : w! force save, under root user, even if the text is read-only can be completed save
- : q! forced exit, all changes not in effect
- : Wq Save and exit, change Mtime
- : Set NU Displays line number
- : Set Nonu does not display line numbers
- : Nohl Suppress highlighting
- : x Save exits if no changes are made to the file Mtime
Extended
- Special usage of VIM
- Vim Common shortcut key summary
- Vim quickly deletes a segment of characters
- Vim garbled
- Keypad issues
- VIM encryption
Vim Edit and Command mode