Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一行代码需要在 Vim 中替换。我需要替换一行代码errors += 1;来errors++;简化它。
errors += 1;
errors++;
当我这样做时,:%s/errors += 1;/errors++;/a我得到E488:Trailing Characters.
:%s/errors += 1;/errors++;/a
E488:Trailing Characters
有谁知道如何做到这一点?
最后你有/a一个标志:a不是替代标志。没有a这应该适合你。
/a
a
c如果您想手动确认每次更换,请使用。
c
如果g要替换一行中的所有匹配项,请使用此选项。
g