3 ms·
Look around for "vim grammar". There were a couple of posts recently about this subject: basically you should consider Vim's commands/motions/text-objects/count
by johncoltrane 14y ago
Look around for "vim grammar". There were a couple of posts recently about this subject: basically you should consider Vim's commands/motions/text-objects/count as the lexical parts of a language that you combine to form phrases.
This a simple example of combining commands in Vim, first in English, then in Vim-speak:
I want to turn this line into a paragraph, make it UPPERCASE and duplicate it 10 times.
yss<p>vitgU10p
gU$yss<p>10p
...
Like for everything in Vim, there are many ways to do that. The optimal order is not always the most natural but it's often close and it's almost always faster than in other editors.
- addisaden 14y agoWhile looking around i found a book from PragmaticProgrammers for the vim. Compact and save my time. Vim is more than just another editor and its fast. What the heck does ss on the beginning? The rest of this command is clear.
- johncoltrane 14y agoyss comes from Surround.vim. It's the command used to wrap the current line with "whatever" comes after: yss<p> yss" and so on… Surround is a killer plugin.