mirror of
https://github.com/sahinakkaya/til.git
synced 2024-12-22 23:29:37 +01:00
785 B
785 B
Let's say you have the following text in your buffer:
- quick
- brown
- fox
- jumped
- over
- the
- lazy
- dog
It's a pain to go each one of them and change them accordingly. Until now, I would solve this problem by creating a macro and applying it to the other lines. But there is a better solution. Visually select all of them and press g<C-a>
. And the list will become:
- quick
- brown
- fox
- jumped
- over
- the
- lazy
- dog
From the help page:
{Visual}g CTRL-A Add [count] to the number or alphabetic character in
the highlighted text. If several lines are
highlighted, each one will be incremented by an
additional [count] (so effectively creating a
[count] incrementing sequence). {not in Vi}