This is useful when commenting out (or in) blocks of code/text in a file.
Move the cursor to the first line you wish to comment out.
Press shift - v to begin block selection mode. The bottom of the screen will say:
-- VISUAL LINE --
Press down arrow to select the text you wish to comment out. When finished, press : (colon)
The bottom of the screen will change to:
:'<,'>
Append the search and replace statement (replace the beginning of the line – nothing – with a # symbol):
:'<,'>s/^/#
To comment in – or uncomment blocks use this statement (replace the # symbol at the beginning with nothing):
:'<,'>s/^#//