I'd like to delete all spaces on empty lines before saving files. I've figured out how to do that.
autocmd BufWritePre * silent! %s/\v^\s+$//e
But this moves my cursor to the line where the spaces have been removed. I know that not in autocmd I can just press
'' and that would do what I want, but I can't figure out how to achieve this in autocmd.