How do I change the case (uppercase, lowercase) of a word or a

character or a block of text? You can use the “~” command to switch the case of a character. You can change the case of the word under the cursor to uppercase using the “gUiw” or “viwU” command and to lowercase using the “guiw” or “viwu” command. You can switch the case (upper case to lower case and vice versa) of the word under the cursor using the “viw~” or “g~iw” command. You can use the “gUgU” command to change the current line to uppercase and the “gugu” command to change the current line to lowercase. You can use the “g~g~” command to switch the case of the current line. You can use the “g~{motion}” or “{Visual}~” commands to switch the case of a block of text. If you set ‘tildeop’ the “~” command behaves like an operator and expects a motion command to act on. If you have

    :set tildeop

and you want to change the case from the current cursor position to the end of line, simply use “~$”.

Comments (1)


Pepsh Pepshinsky

Let’s see you to :help viminfo-file-name (option -i) :set viminfofile=NONE


Speak Your Mind