When I write //
comments in Java, and press Enter, vim helpfully adds a //
to the beginning of the next line.
// This is the first line of my comment <CR>
// <-- these were added automatically by auto-comment.
As I say, this is helpful behaviour (I use //
for multi-line comments to make it easy to comment out large blocks of code with /*...*/
, and use /**...*/
only for Javadoc comments). But when I've reached the end of a comment, I have to press the backspace key three times to get rid of the //
at the beginning of the line that I now no longer want.
Is there a keyboard shortcut from Insert mode that can tell Vim that I'm no longer writing a comment? Or do I have to write my own?