title: How can I trim trailing whitespace in Visual Studio 2012 on save?
body: <p>Now that macros are gone from Visual Studio 2012, what is the best way to automatically trim trailing whitespace whenever a file is saved?</p>
  <p>I'm aware that <em>Format Document</em> (<kbd>Ctrl</kbd> + <kbd>K</kbd>, <kbd>Ctrl</kbd> + <kbd>D</kbd>) will do this, but it presumably changes the file in other ways, and it's not automatic either.</p>
  <p>The motivation is given here:</p>
  <p><em><a href="http://codeimpossible.com/2012/04/02/trailing-whitespace-is-evil-don-t-commit-evil-into-your-repo/" rel="nofollow noreferrer">Trailing whitespace is evil. Don't commit evil into your repo</a></em></p>