title: Vim: creating a C string literal around a block of text with vertically aligned quotes?
body: <p>I would like to create a macro or a script in Vim that does the following:</p>
  
  <ol>
  <li>wrap a block of text in double quotes</li>
  <li>escaping any quotes that appear in the text itself</li>
  <li>have the quotes on the right side in vertical alignment</li>
  </ol>
  
  <p>For example:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;&lt;/head&gt;
  &lt;body&gt;
  &lt;h1&gt;High Score Server&lt;/h1&gt;
  &lt;table&gt;
  ROWS
  &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>would become:</p>
  
  <pre><code>"&lt;html&gt;                    "
  "&lt;head&gt;&lt;/head&gt;             "
  "&lt;body&gt;                    "
  "&lt;h1&gt;High Score Server&lt;/h1&gt;"
  "&lt;table&gt;                   "
  "ROWS                      "
  "&lt;/table&gt;                  "
  "&lt;/body&gt;                   "
  "&lt;/html&gt;                   ";
  </code></pre>
  
  <p>I am able to achieve this with a macro, but without the vertical alignment of the quotes on the right side. Can anyone help me with this one?</p>