VI several shortcut keys, record the memo
I. Cursor movement
1. Move the cursor to the file to start pressing the GG two key
2. Move the cursor to the end of the file press the G key
3. Move the cursor to the wardrobe press ^
4. Move the cursor to the end of the line by pressing $
Two. Editing
1. Delete a (cursor) word (alphanumeric string) press DW two key
2. Delete (cursor) line press DD two key
3. Press the * key at the full text search cursor
4. Search under (top) a match word press N (n) key
5. Search for {[(or}]) with the symbol that matches the current cursor by the% key
6. The man file that brings up the function at the cursor press the K key (that is, shift-k)
7. Find and replace 50 to 100:50, 100s/old/new/g
8. Full-text find and replace, and prompt before replacing:%S/OLD/NEW/GC
9. Add (delete) bookmark a press MA (:d Elm a)
10. Save all open files: WA
11. Exit all open files after saving all: WQA
Three. Other
1. Horizontal (vertical) Split screen view another file: vs (sp) newfile
2. Open the file name at the cursor (current directory), press G (O) F (ile) key
3. Turn on (OFF) syntax coloring: syntax on (off)
4. Show (hide) line number: Set Nu (Nonu)
5. The selected area re-syntax indent press the = key
6. Run a command:!command
7. Displaying files in ASCII code:%!XXD
8. Close other Windows outside the current window: only
9. Toggle the active window ctrl-w
10. Cursor moves between multiple Windows Ctrl-w-H (j,k,l)
11. Window Resizing ctrl-w-+ (-)
12. (When multi-window) Move the window (relative position) ctrl-w-H (j,k,l)
VI Shortcut keys