I got rather long sql script where all keyword are uppercase. I want to change them to lowercase, but preserve exact values of string literals and my own identifers.
For example, in this text:
KEYWORD BEFORE 'SOME STRING LITERAL' KEYWORD AFTER
mixedCaseValue
MY_OWN_VARAIBLE
UGLY APPERCASE KEYWORDS, other text
I want only ‘KEYWORD BEFORE’, ‘KEYWORD AFTER’ and last ‘UGLY UPPERCASE KEYWORDS’ to be lowercase and all other left intact.
If I use something like this :%s/\<\u\+\>/\L&/g, text inside quotes on the first line is also affected.
Do you have any ideas?
Assuming that string literals do not span over multiple lines, and that there is
no syntax for escaping single quotes inside string literals, I would use the
following substitution command.