title: Vim -- comment auto-wrapping messes up block insert
body: <p>I use vim's block insert to comment blocks of code like this (think of the square brackets as the cursor): </p>
  
  <pre><code>[k]eyword {
    variable declaration;
    return_type function_or_something() {
      for (a; b; c) {
        do_something_funky();
      }
  }
  </code></pre>
  
  <p>Hit <code>Ctrl+V</code> <code>6jI//</code> <code>Space</code> <code>Esc</code></p>
  
  <pre><code>[/]/ keyword {
  //   variable declaration;
  //   return_type function_or_something() {
  //     for (a; b; c) {
  //       do_something_funky();
  //     }
  // }
  </code></pre>
  
  <p>All nice and neat, but in this situation: </p>
  
  <pre><code>[k]eyword { // this is a block of code with a somewhat long comment
    variable declaration;
    return_type function_or_something() {
      for (a; b; c) {
        do_something_funky();
      }
  }
  </code></pre>
  
  <p>Hit <code>Ctrl+V</code> <code>6jI//</code>, at this point the combination of <code>textwidth=80</code> and <code>formatoptions=caq1njw</code> kick in, and since my <code>//</code> has pushed the line over the textwidth, it triggers the wrap, and once that happens, my visual block insert operation is toast, so only the first line actually ends up getting commented out, and as a result I let loose a string of expletives. </p>
  
  <pre><code>[/]/keyword { // this is a block of code with a somewhat long
  //comment
    variable declaration;
    return_type function_or_something() {
      for (a; b; c) {
        do_something_funky();
      }
  }
  </code></pre>
  
  <p>Seems like a long shot, but I wonder if anyone knows of a workaround/fix... Maybe I can temporarily blow away <code>formatoptions</code> when I start a visual block selection? How to do that?</p>
  
  <p>Note: I tried hitting <code>o</code> right before <code>I</code> to put the cursor at the bottom edge of the block selection, but it doesn't help, the way it works is once you hit <code>I</code> it will reposition the cursor to the top line, which subsequently screws you over as you turn the line into a comment.</p>