title: How can I convert spaces to tabs in Vim or Linux?
body: <p>I've looked over several questions on Stack Overflow for how to convert spaces to tabs without finding what I need. There seem to be more questions about how to convert tabs to spaces, but I'm trying to do the opposite.</p>
  
  <p>In <code>Vim</code> I've tried <code>:retab</code> and <code>:retab!</code> without luck, but I believe those are actually for going from tabs to spaces anyways.</p>
  
  <p>I tried both <code>expand</code> and <code>unexpand</code> at the command prompt without any luck.</p>
  
  <p>Here is the file in question:</p>
  
  <p><a href="http://gdata-python-client.googlecode.com/hg-history/a9ed9edefd61a0ba0e18c43e448472051821003a/samples/docs/docs_v3_example.py">http://gdata-python-client.googlecode.com/hg-history/a9ed9edefd61a0ba0e18c43e448472051821003a/samples/docs/docs_v3_example.py</a></p>
  
  <p>How can I convert <strong>leading</strong> spaces to tabs using either <code>Vim</code> or the shell?</p>