I am going to post some notes when I learn some new useful command/macro.
One useful function is to change letter case. For one character, you can simply use "~" to change to case from upper to lower or vice versa.
However, what if I want to change whole passage to UPPERCASE or lowercase. We can use gU / gu command.
1. Change whole passage to lower case
you can use "ggguG" in command mode.
Explain:
- gg - go to the first line and first character
- gu - change letter to lower case
- G - go to the last character of last line
2. You can use motion command to change case
guw、gue、gUw、gUe
3. some special combinations
- gUU - change current line to uppercase
- 10gUU - change 10 lines including current line to uppercase
- gU0 - change first character of current line to uppercase
- gU$ - change last character of current line to uppercase
- gUG - change character from current position to last charactor of last line
No comments:
Post a Comment