:command Linecomment :normal ^i/*<ESC>$a*/<ESC>
The above command is one that I came up with in order to comment out an entire line in C, normally for debugging purposes and whatnot.
I was wondering what sort of modifications would be needed to turn this into a function, and what similar function would comment from the cursor position to the end of the line?