CTRL + SHIFT + Y changes to lowercase. CTRL + SHIFT + X changes to UPPERCASE.
Using character sets For example, the regular expression "[ A-Za-z] " specifies to match any single uppercase or lowercase letter. In the character set, a hyphen indicates a range of characters, for example [A-Z] will match any one capital letter.
This can be done easily using regular expressions. In a substitute command, place \U or \L before backreferences for the desired output. Everything after \U , stopping at \E or \e , is converted to uppercase. Similarly, everything after \L , stopping at \E or \e , is converted to lowercase.
I just resolved the same task (had to turn .net interface into java interface) utilizing the power of VIM :)
void DoMethod1 -> void doMethod1
Foo PerformMethod2 -> Foo performMethod2
:%s/\(^\s*\w\+\s\+\)\([A-Z]\)/\1\L\2/g
Here we are searching for (optional indentation followed by return type followed by whitespace) followed by (Uppercase letter). Braces are capturing groups. Then we are performing a replacement first capturing group \1 lowercase \L second capturing group \2.
This of course requires you to open file in Vim, but anyway this is much faster then doing the same thing by hand in Eclipse.
That is not possible. Either use Eclipse's re-factoring functionality, or replace them one at a time:
regex : \bk_A
replacement : k_a
regex : \bk_B
replacement : k_b
...
regex : \bk_Z
replacement : k_z
I needed to do this for a huge chunk of source code where string literals needed to be converted to lowercase. I found a way using Notepad++ and the Python Script plugin, as used here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With