Continue comment on the next line



I would like to know if it was possible to be able to reproduce line comments when hitting enter (for a new line) without creating having to write them.

Example(in c language):

//some comment

What I would like to get when hitting enter (for a new line of comment)

//some comment
// <- with this automatically inserted

And this is what I get

//some comment
<cursor here> and a blank line

I hope I made myself clear enough to be able to understand my request.

Thank you very much in advance for any response :smile:


The docblockr package provides this feature.


I was just about to say that. Not exactly what OP wants, but it would be a good place to look to make a package that does.


Wow, thank you very much for your quick reply :smile:

I’ll take a look at the package then


For the record, I found this old topic while searching for my problem: I had exactly the reversed issue!
Ie. when I type Enter after a single line comment //, the line starts with a comment.
But, I use to use these single line comments, as their name implies, generally for single lines. The exceptions are rare and I can type these three characters myself in these cases.
Anyway, I finally found out that’s a “problem” introduced by the Atom Easy JSDoc package.

So, if you like this effect, you can use this package for that. :wink: