Search code examples
vimdictionaryuppercaselowercase

vim: gU and gu in one map


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?


Solution

  • 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.