From the vim-as-language article:
Vim’s "verbs" mostly fall into 2 main categories. Some of them act on a single character, and others act on a "motion" or "text object".
And from the vim wiki for switching the case of characters:
Toggle case
"HellO"
to"hELLo"
withg~
then a movement.
Uppercase"HellO"
to"HELLO"
withgU
then a movement.
Lowercase"HellO"
to"hello"
withgu
then a movement.
In this case, it seems like Lowercase
is the action. Would "the current line" be considered a movement or text object?
For example given the line (with my cursor at the |
):
pgp - Pretty Good Privac|y
I'm wondering use the action-movement pattern to "downcase the current line" works in this case. I used gu0
which worked.
But what if the cursor is in the middle of the line like:
pgp - Pretty Go|od Privacy
Then, gu0
followed by gu$
will work, but it seems "the current line" should be a text-object. I also used guk
or guk
which works but I'm not sure if I'm thinking about the pattern the right way.