1. Insert command (can be used with number) I insert I before current position insert a at the beginning of the current Insert a at the end of the current line after the current position insert O insert a row after the current line O Insert a line before the current line NI/a/o/i/a/o<esc>Insert N characters2. Move command (can be used with numbers) h move single character l to right move single character K Move up single character J Move down single character NH/l/k/J Move N characters gg move to file header G/Shift+g move to end of file (: N<Enter>)/(NG) jumps to nth row"'jump back just starting point M (a...z) to the current line tag'a jumps to the line of Mark a: Marks View all current tags:d elm!Remove All tags (n)WMove forward (N/) a word (n) b moves backwards (n/) A single word3. Delete command (can be used with numbers) x delete a single character x delete the previous character of the current character NX Delete N characters dj delete next line DK Delete previous lineDDDelete (cut) The current line D Delete the current character to the end of the line4undo Redo Command U undo Ctrl+R Redo (revoked revocation) Vsvim not available5. Indent commandsShift+v Select when moving forward, you can continue to move in the input move command>Right Indent<Left indent n>/<Indent n Tab5. Replace command RA to replace the current character with A:s/old/new/replace new with old, replacing the first match of the current row: s/old/new/G replaces new with old, replacing all occurrences of the current line:%s/old/new/replace new with old to replace the first match for all rows:%s/old/new/G replaces new with old, replacing all occurrences of the entire file6The . Exchange command DDP swaps the current line and its next line XP swaps the current character and one character after it7. Cut command (n)DDCut the current row (and the next n rows): N1,n2d will N1-N2 Line cut. You can paste the cut content with the P command: N1,N2MN3 will N1-N2 Line cut paste to N38. Other basic Commands%bracket matching (to match one parenthesis for the purpose of moving)/text Find text, press N to find the next, press N to find the previousDDDelete (cut) Current line YY copy current line p in when Paste Next line forwardShift+p paste on the previous line of the current row
Photo reproduced: http://blog.csdn.net/scythe666/article/details/51887179
Vsvim shortcut keys to use