Vim substitute command
:%s/old/new/g will replace all occurrences of
new. But I want to do this replacement only in lines that do not start with
#. I mean in my file there are some lines starting with # (called commented lines) which I want to exclude in search replace. Is there any way to do it?
You should mix it with the
help :global) command: