I am getting \'trailing whitespace\' errors trying to commit some files in git.
I want to remove these trailing whitespace characters automatically right before I sa
This is how I'm doing it. I can't remember where I stole it from tbh.
autocmd BufWritePre * :call StripWhite() fun! StripWhite() %s/[ \t]\+$//ge %s!^\( \+\)\t!\=StrRepeat("\t", 1 + strlen(submatch(1)) / 8)!ge endfun