title: How to maintain tabs when pasting in Vim
body: <p>I use the tab key to indent my python code in Vim, but whenever I copy and paste a block Vim replaces every tab with 4 spaces, which raises an <code>IndentationError</code></p>
  
  <p>I tried setting <code>:set paste</code> as suggested in related questions but it makes no difference</p>
  
  <p>Other sites suggest pasting 'tabless' code and using the visual editor to re-indent, but this is asking for trouble when it comes to large blocks</p>
  
  <p>Are there any settings I can apply to vim to maintain tabs on copy/paste?</p>
  
  <p>Thanks for any help with this :) </p>
  
  <p><strong>edit:</strong></p>
  
  <p>I am copying and pasting within vim using the standard gnome-terminal techniques (ctrl+shift+c / mouse etc.)</p>
  
  <p>my .vimrc is:</p>
  
  <pre><code>syntax on
  set ts=4
  if has("terminfo")
  let &amp;t_Co=8
  let &amp;t_Sf="\e[3%p1%dm"
  let &amp;t_Sb="\e[4%p1%dm"
  else
  let &amp;t_Co=8
  let &amp;t_Sf="\e[3%dm"
  let &amp;t_Sb="\e[4%dm"
  endif
  </code></pre>
  
  <p>I looked up that ts -> Sets tab stops to n for text input, but don't know what value would maintain a tab character </p>