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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You have
/aat the end as a flag:aisn’t a substitute flag. Without theathis should work for you.Use
cif you want to manually confirm each replacement.Use
gif you want to replace all occurrences on a line.