Continue comment on the next line


#1

Hello,

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:


#2

The docblockr package provides this feature.


#3

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.


#4

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

I’ll take a look at the package then


#5

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: