My Vim replace with a regex is throwing a `E488: Trailing characters`

If you have this when replacing within a selected block of text, it may be because you mistakenly typed %s when you should only type s

I had this happen by selecting a block, typing : and at the prompt :'<,'>, typing %s/something/other/ resulting in :'<,'>%s/something/other/ when the proper syntax is :'<,'>s/something/other/ without the percent.

Leave a Comment