I have looked at the following question:
How to comment out a block of Python code in Vim
But that does not seem to work for me. How do I comment code easily wit
You can add this to your .vimrc file
.vimrc
map :s/^/\/\//
Then when you need to comment a section just select all lines (Shift-V + movement) and then press CtrlC.
To un-comment you can define in a similar way
map :s/^\/\///
that removes a // at begin of line from the selected range when pressing CtrlU.
//