I have one line of code that I need to replace in Vim. I need to replace one line of code errors += 1;
to errors++;
just to simplify it.
When I do :%s/errors += 1;/errors++;/a
I get E488:Trailing Characters
.
Does anyone know how to do this?
I have one line of code that I need to replace in Vim. I need to replace one line of code errors += 1;
to errors++;
just to simplify it.
When I do :%s/errors += 1;/errors++;/a
I get E488:Trailing Characters
.
Does anyone know how to do this?
You have /a
at the end as a flag: a
isn't a substitute flag. Without the a
this should work for you.
Use c
if you want to manually confirm each replacement.
Use g
if you want to replace all occurrences on a line.