title: Word Wrap in Vim (preserving indentation)
body: <p>I was just looking at <a href="https://stackoverflow.com/questions/744159/word-wrap-in-gvim">this post</a> which describes how to wrap entire words in vim.  The accepted solution was this:</p>
  
  <pre><code>:set formatoptions=l
  :set lbr
  </code></pre>
  
  <p>Which takes this text (tabs are shown as \t):</p>
  
  <pre><code> *Inside of window                        *Outside of window
  |---------------------------------------|    
  |\t\tthis is a like of text that will wr|ap here                            
  |\t\tcan you see the wrap               |
  |                                       |
  |---------------------------------------|
  </code></pre>
  
  <p>This accomplishes a behavior like this (tabs are shown as \t):</p>
  
  <pre><code> *Inside of window                        *Outside of window
  |---------------------------------------|    
  |\t\tthis is a like of text that will   |
  |wrap here                              |
  |\t\tcan you see the wrap               |
  |                                       |
  |---------------------------------------|
  </code></pre>
  
  <p>I would however like to redefine this function.  I would like the wrapped line to have the same number of tabs in front of it that the line above has plus one.  Ie:</p>
  
  <pre><code> *Inside of window                        *Outside of window
  |---------------------------------------|    
  |\t\tthis is a like of text that will   |
  |\t\t\twrap here                        |
  |\t\tcan you see the wrap               |
  |                                       |
  |---------------------------------------|
  </code></pre>
  
  <p>Any ideas?</p>