Have you found yourself in the need to either capitalize or de-capitalize a large amount of text, and realized that your text editor did not have that capability, so you proceeded to re-type all of your text in your desired capitalization?
Re-type no more!!! vi will save you, as it has save many others so often before!!
http://www.lefred.be/?q=node/75
Re-type no more!!! vi will save you, as it has save many others so often before!!
- Open your file in vi.
- To convert all to uppercase, press gggUG
- To convert all to lowercase, press ggguG
- Done!
Alternatively, you can type in either of these longer vi commands:
- <ESC>:%s/.*/\L&/
- <ESC>:%s/.*/\U&/
though surely variations of these allow you much greater flexibility for more precise and/or complex substitutions.
Enjoy!
And of course, credits due to:
http://www.lefred.be/?q=node/75
No comments:
Post a Comment