Skip to content

Instantly share code, notes, and snippets.

@takeshy takeshy/.vimrc
Created Nov 15, 2018

Embed
What would you like to do?
remove trailing space on save
function! <SID>StripTrailingWhitespaces()
let l = line(".")
let c = col(".")
%s/\s\+$//e
call cursor(l, c)
endfun
autocmd BufWritePre *.ts,*.rb,*.tsx,*.js,*.erb :call <SID>StripTrailingWhitespaces()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.