How to Comment Out All Lines in the VI Editor. Comment out every line of a file in vi with one search-and-replace command, plus how to comment a range, undo it and use Vim visual block mode.
VI Editor Search and Replace Commands. Reference for vi search and replace with :s, covering the current line, the whole file, line ranges, marks and the :g command, with confirm and case flags.