At least in VIM you can select the first column of text you want to insert using Block Visual mode (CTRL+V
in non-windows VIMs) and then prepend a #
before each line using this sequence:
I#
In Block Visual mode I
moves to insert mode with the cursor before the block on its first line. The inserted text is copied before each line in the block.