The goal is to replace individual double quotes " with single quotes ' without affecting docstring triple double quotes """. %s/([^"])"([^"])/$1'$2/g