Suddenly simple find&replace stopped working in one particular case. I'm selecting the code-block in visual-mode, so the final command looks like:


I get the error:

Trailing characters

It's very strange behavior because the same commands worked very well earlier.

Search and replace in VIM results in trailing characters didn't help.


You don't need %, as you already have another range ('<,'>) for your command s. So it must be simply '<,'>s/SomeStuff/stuff/gI.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.