title: Remove surrounding lines in vim
body: <p>I often surround some code/text with some other lines of text. For the sake of a concrete example, say I have some text:</p>
  
  <pre><code>this is 
  some text
  </code></pre>
  
  <p>I then have macro that lets me convert that (after highlighting the lines) to</p>
  
  <pre><code>if false then
      this is
      some text
  end;
  </code></pre>
  
  <p>the macros I use to do this are:</p>
  
  <pre><code>nmap &lt;space&gt;i ccif false then&lt;CR&gt;&lt;c-r&gt;"end;&lt;esc&gt;
  vmap &lt;space&gt;i cif false then&lt;CR&gt;&lt;c-r&gt;"end;&lt;esc&gt;
  </code></pre>
  
  <p>However I would like to be able to create macro to then remove the surrounding text. That is, if the cursor is surrounded by lines "if false then" and "end;" then those lines should be removed. </p>
  
  <p>Any ideas how I would create a macro like that?</p>
  
  <p>Let me note that I have looked at surround.vim, but have not found a way to do it using that package.</p>