title: Copy/paste from Visual Studio to browser with formatting intact
body: <p>I frequently share code snippets on a WordPress blog and a webforum (phpbb). </p>
  
  <p>I use Visual Studio 2010 with the <a href="http://visualstudiogallery.msdn.microsoft.com/d0d33361-18e2-46c0-8ff2-4adea1e34fef" rel="nofollow">Productivity Power Tools</a>. </p>
  
  <p>By using the <strong>Align Assignment</strong> option of this extension (<code>Ctrl+Alt+]</code>) I get nice formatting:</p>
  
  <pre><code>static void Main()
  {
       int firstInt              = 20;
       int secondInt             = 50;
       int thisWillBeTheThirdInt = 100;
  }
  </code></pre>
  
  <p>However, if I copy-paste (or copy-paste without formatting) to a website form with FireFox, Chrome, or paste into Notepadd++, the format reverts back to:</p>
  
  <pre><code>static void Main()
  {
      int firstInt       = 20;
      int secondInt         = 50;
      int thisWillBeTheThirdInt = 100;
  }
  </code></pre>
  
  <p><strong>Question</strong>: how can I copy code <em>with</em> the assignments aligned?</p>
  
  <p>What did not work so far:</p>
  
  <ul>
  <li>Paste as plain text with AutoHotKey,</li>
  <li>The <a href="http://visualstudiogallery.msdn.microsoft.com/f5d2ff29-cf19-4762-b4cc-01cefbbbb471" rel="nofollow">Untabify Replacement</a> extension,</li>
  <li>I do not have the <a href="http://blogs.msdn.com/b/zainnab/archive/2010/03/14/how-to-convert-tabs-to-spaces-and-vice-versa-vstipedit0028.aspx" rel="nofollow">tabify/untabify options</a> in VS2010, apparently since the Productivity Power Tools <a href="http://social.msdn.microsoft.com/Forums/vstudio/en-US/2e8db05b-cadf-4f62-bdd5-bbc644e5e3eb/how-do-i-get-rid-of-tabifyuntabify-question?forum=vseditor" rel="nofollow">disables</a> that.</li>
  </ul>
  
  <p>Using the <a href="http://visualstudiogallery.msdn.microsoft.com/91a3f8ae-3152-438a-b5fc-fb37878dd007" rel="nofollow">Better Fixed Mixed tabs</a> did help somewhat, since most of the spaces were replaced by tabs (which do get copied/pasted correctly). However, spaces that remain still lead to messed up formatting when copy-pasting.</p>