Most programming languages have special characters such as
# PHP, cmake, (endless more langugaes) // C/C++, (endless more) -- SQL or multiline comments {- Haskell -} /* C++ C etc */
drop # at the beginning: (jj representing any up/down movement):
<c-v>jjd
or by regex:
%s@^#@@
add # at the beginning: (jj representing any up/down movement)
<c-v>jjI#<esc>
or by regex:
%s@^#@@
You can use "finish" make Vim ignore rest of the file. (Nice for keeping your own memories etc). You're missing /* .. */ ? try if 0 ... endif
There are many plugins. One of the most simple yet powerful ones is vim-addon-commenting. Its Readme references alternative solutions.