Skip to content
Go back

Trailing Whitespace, No More!

Published:  at  10:33 AM
1 min read

Nobody likes trailing whitespace. I usually notice them only when looking at my committed changes.

Stripping extra white space always seemed like something I shouldn’t worry about.

Today I learned about a cool vim plugin called vim-better-whitespace, by ntpeters.

The Basics

After installation using your favorite plugin manager, try the following

:ToggleWhitespace
:StripWhitespace
autocmd BufEnter * if index(g:better_whitespace_filetypes_blacklist, &ft) < 0 | exec 'EnableStripWhitespaceOnSave' | endif

[1] There’s an open issue regarding the use of blacklist file types when enabling whitespace stripping on file save. The line I wrote above is the author’s suggested fix.

Learn more and contribute at GitHub or Vim.org.




Previous Post
Markdown All The Things
Next Post
Sweater Weather