a9zoba
Last Updated: February 25, 2016
·
162
· iamjarvo
C4b4c7e00f64c5596b05765614b23777

Switching case in vim

Have you experienced the pain of holding the shift button for too long while coding ? You end up with something like this findByusername. In vim you can convert the word to a specific case or toggle the case.

# select the word
viw

# convert all letters to lowercase 
gu #=> find_by_username

# convert all letters to uppercase
gU #=> FIND_BY_USERNAME

# toggle case
g~ #=> FIND_bY_USERNAME
Say Thanks
Respond
Filed Under