<p>For plain standard vi, do this:</p>
<ol>
<li>Go to the starting line of the block</li>
<li>ma (to mark the start of the block)</li>
<li>Move to the end of the block.</li>
<li>:'a,.s/^/#/</li>
</ol>
<p>Basically, you go to to the first line of the block and mark it and you may as well use register a. So that's ma.</p>
<p>Then you move to the end of the block and you do a search and replace.</p>
<p>: puts you into ex mode</p>
<p>'a is the start of the search block and it refers to the mark you made earlier</p>
<p>. is the current line</p>
<p>so the whole block is described by 'a,. (dash a comma dot)</p>
<p>then you replace the start of the line with a #, but only for that specified block (s/^/#/)</p>
<p>This is standard vi, so it will work for you.</p>