Sublime Text 2 Strip Whitespace on Save
Nov 18, 2012
I’ve become fond of Sublime Text 2. Gasp! Wait, what? You don’t use emacs/vim/butterflies? Anyway, regardless of the editor, I like to keep my whitespace under control. This usually means I add a hook to strip trailing whitespace when saving. The Sublime Text 2 Python API reference looks pretty complete, but there’s little pragmatic documentation. I tinkered with creating my own, found others that had semi decent solutions, but ultimately gave up. After my failed attempts and failed googling, my coworker informed me that Sublime Text has this built right in as a user setting you can set by adding a simple JSON snippet. Awesome.