|
|
|
|
|
by johncoltrane
5116 days ago
|
|
1. "Basic commands" are what you know after 30 minutes of $ vimtutor
2. "Syntax to chain basic commands" is what you get when you think about what you are going to do. Like in any spoken or written language: "copy this line and paste duplicate it 10 times above" would be yy copy this line
10P paste above, 10 times
You have verbs (yank, paste, delete, join, move down…), direct objects (this word, this line, this html tag, this function, this paragraph…), indirect objects (up to this word, between line y and line x…) and, well… "counts" to do all that multiple times.Vim's language is a lot more natural and intuitive and efficient than any variant of Cmd+Left - Shift+Ctrl+Right - Right - Cmd+c - Down - Cmd+v - Down - Cmd+v - Down - Cmd+v - Down - Cmd+v - Down - Cmd+v - Down - Cmd+v - Down - Cmd+v - Down - Cmd+v - Down - Cmd+v - Down - Cmd+v Saying it's too arcane/complex/hard is just lying or being lazy. 3. "Ability to form other commands from basic commands" is achieved by writing small (or big) functions and bind them to your own commands. 4. "Way to write macros" is by not writing macros. You record a sequence of commands/keystrokes and run it later: qa record a macro in register a
yypj duplicate this line and move to the line below
q stop recording
10@a apply the macro 10 times
No need for a cheat sheet if you are commited and don't rush it. |
|