I have these lines in my .vimrc to help with indentation:
autocmd BufReadPost * set noexpandtab | retab! 4 autocmd BufWritePre * set expandtab | retab! 4 autocmd BufWritePost * set noexpandtab | retab! 4
However, they create a lot of noise in the undo history. Since they essentially do nothing from the user's perspective, I'd like to remove them from the history or at the very least squash them somehow (perhaps they cancel out if squashed together?). Is there a way to do so?