" Strip trailing spaces on write autocmd BufWritePre * :%s/\s\+$//e Aside from the fact that it it sometimes appropriate and necessary to leave whitespace at the end of a line this actually moves the cursor to the spot in question on write. Writing to disk should not move the cursor. This is the sort of change that should be left to the user not stuck in /etc to annoy the user every time they update the neovim package.
Commit that added this https://cgit.gentoo.org/dev/yngwin.git/diff/app-editors/neovim/files/nvimrc?id=2790cee3c2c6bcabaaa674ffd1c2c58857a46248 Note the lines -" We attempt to change as little as possible from Vim's defaults, -" deviating only where it makes sense +" Strip trailing spaces on write +autocmd BufWritePre * :%s/\s\+$//e How appropriate
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e11e10747b61731a547e3389719a0d17e0962b91 While I hold it is a good default to have, I can understand some users not appreciating it. I have refactored the whole default nvimrc that we install, and changed the stripping whitespace functionality to apply to ebuilds and eclasses only, and to be easily turned off with a configuration switch.