Vim Grammar
Using vim is like talking to your editor in number verb modifier object sentences, turned into acronyms
Number
Enter nonzero number before the command, to repeat the command number times.
Verbs
| key | function | verb form | 
|---|---|---|
| v | visual select | transitive | 
| c | change, enter insert mode | transitive | 
| d | delete | transitive | 
| y | yank / copy | transitive | 
| x | delete char | non-transitive | 
| i | insert, enter insert mode, before the cursor | non-transitive | 
| a | append, enter insert mode, after the cursor | non-transitive | 
| p | paste | non-transitive | 
| nN | find next/previous search results of /or? | non-transitive | 
Modifiers
| key | function | 
|---|---|
| i | inside | 
| a | around | 
| t | till find a character, not including the character | 
| f | find a character, including the character | 
| / | search downwards, find a string or regex | 
| ? | search upwards, find a string or regex | 
Objects
| key | function | 
|---|---|
| w | word | 
| s | sentence | 
| b | block / parentheses | 
| p | paragraph | 
| t | tag, for html/xml tags | 
| G | go to the last line | 
| numberG | go to the number line | 
| gg | go to the first line, the same as 1G | 
| 0 | number 0, to the first character of current line | 
| $ | to the last character of current line | 
Examples
Key
| key sequence (command mode) | function | 
|---|---|
| x | delete the current character | 
| p | paste | 
Number + Key
| key sequence (command mode) | function | 
|---|---|
| 8x | delete the next 8 characters | 
| 2j | move down the cursor by 2 lines | 
Key + Object
| key sequence (command mode) | function | 
|---|---|
| dw | delete to the end of the (next) word | 
| cw | delete to the end of the (next) word, enter insert mode | 
Key + Modifier + Object
| key sequence (command mode) | function | 
|---|---|
| diw | delete the current word | 
| ciw | change the word, enters insert mode | 
| cis | change current sentence | 
| ci" | change inside " " | 
| ci{ | change inside { } | 
| c/foo | change until next occurrence of foo | 
| ct8 | change everything from here until number 8 | 
| cf8 | like above, but also remove the number | 
| cap | change the current paragraph | 
| vap | visually select this paragraph | 
Reference Chart



Reference Link
Learn to speak vim — verbs, nouns, and modifiers!
Using "verbs" and "nouns" for text editing
Vi/vim emulation for Visual Studio, SQL Server, Word & Outlook
 
  
 
0 Comments