title: How to cut and paste tabbed lines with auto indent set to on in vi
body: <p>Not sure which stack exchange group this question goes so please move to the correct one if this is the wrong one.</p>
  
  <p>What's happening is if I highlight something with tabs/indents from one window/browser and want to paste it into vi, the formatting gets messed up.</p>
  
  <p>For example, I have the following in another window that I want to copy:</p>
  
  <pre><code>   "date_created" : "2013-06-06 21:12:31",
     "netdriver_duplex" : "Full",
     "mac_address" : "FA:16:3E:17:CC:E1",
     "interfaces" : "eth0,sit0",
     "processors" : null
  </code></pre>
  
  <p>After I highlight it and paste it in vi, I get the following:</p>
  
  <pre><code>   "date_created" : "2013-06-06 21:12:31",
        "netdriver_duplex" : "Full",
           "mac_address" : "FA:16:3E:17:CC:E1",
              "interfaces" : "eth0,sit0",
                 "processors" : null
  </code></pre>
  
  <p>Someone told me auto-indent is messing me up and to run </p>
  
  <pre><code>ESC-&gt; :set noai
  Copy/Paste stuff
  ESC-&gt; :set ai
  </code></pre>
  
  <p>but this gets tiring after a while.  Is there a workaround when pasting tabbed lines in vi with autoindent set to on or do I have to turn off auto-indent, paste, turn ai back on every time?</p>
  
  <p>Thanks in advance for your help.</p>