in vim, with
gUw
make the word uppercase, with
guw
make the word lowercase.
how I can convert in one map the upper to lower and the lower to upper?
If you're trying to invert case, you can use ~
. Normally this works only on the selection (e.g. visual mode), but if you want it to be more useful, then :set tildeop
so you can do ~w
or whatever movement command you like.
~
didn't act like an operator. Adding tildeop
. Thanks!
~
recently, so why would you not want it to act like an operator?
You can use the tilde operator with global commands too: g~w
The advantage being, that you can then use the .
operator to repeat the operation :)
g~
forces ~
to act as an operator, even if you set notildeop
.