Skip to content

Instantly share code, notes, and snippets.

@Rembane
Created September 9, 2021 19:21
Show Gist options
  • Save Rembane/e8c69d4c293e1c21111d076fcb93afcf to your computer and use it in GitHub Desktop.
Save Rembane/e8c69d4c293e1c21111d076fcb93afcf to your computer and use it in GitHub Desktop.
" Kill trailing whitespace
function! <SID>StripTrailingWhitespaces()
let l = line(".")
let c = col(".")
%s/\s\+$//e
call cursor(l, c)
endfun
autocmd BufWritePre * :call <SID>StripTrailingWhitespaces()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment