I have the following line in .vimrc .
autocmd BufWritePre * silent! v/\_s*\S/d
This removes empty lines at the end of files when saving. The problem is that when it splits lines, it also moves the cursor to the last line of the file. Is there a way to avoid changing the location of the cursor?
source share