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 the line where the spaces have been removed. I know that not in autocmd I can just press
'' and that would to what I want, but I can't figure out how to use this in autocmd.