I've the following sample INI file:
Foo=1
Bar=1
Baz=1
Qux=1
and my goal is to set all options to 0 except Foo
.
To disable one selected line, I know that I can run:
%s/Foo=\zs.*$/0/
Test command in shell:
$ ex +"%s/Foo=\zs.*$/0/p" -scwq file.ini
Foo=0
How can I negate substitution pattern, for example disabling every other option apart of Foo
?
I'm also open for suggestions to use different commands instead to achieve the same result.
:g!/Foo/norm f=lC0