Often I find myself inverting quotes:
from double quotes "" to single quotes '' and
from single quotes '' to double quotes "".
I know there is a way to switch single quotes to double quotes:
:%s/'\(\([^']*\)\)'/"\1"/g
And a way to switch double quotes to single quotes:
:%s/"\(\([^"]*\)\)"/'\1'/g
but how do I do both operations together without including the first swapped quotes in the 2nd swapping?
If there is no escaped quotes inside string literals and it is not needed to
ensure correct pairing of quotes, one can use the command