title: To comment out matches in Vim
body: <p>I would like to comment out each line which has the following match</p>
  
  <pre><code>^.*pdf
  </code></pre>
  
  <p>You need to somehow consider the situation by globbing. I try to make an object of the match by brackets.</p>
  
  <p>I run unsuccessfully the following commands</p>
  
  <pre><code>%s/^(.*pdf)/^%$1/
  </code></pre>
  
  <p>and</p>
  
  <pre><code>%s/^(.*pdf)/^(%*$1)/
  </code></pre>
  
  <p>and</p>
  
  <pre><code>%s/^(.*pdf)/^%\$1/
  </code></pre>
  
  <p><strong>How can you comment out the matches in Vim?</strong></p>