Hi,

As the title says, I want to automatically remove trailing spaces when
I save a file. This is what I put in my vimrc:

au BufWrite * %s/\s\+$//ge

This works correctly only when at least one match is found, an error
is issued if I want to save a file without trailing spaces. However,
using the 'e' flag for the substitute command should discard any such
error (at least it's working when I use this command interactively).
Did I miss something?

Reply via email to