Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continue comments #1730

Open
antoyo opened this issue Mar 3, 2022 · 6 comments · May be fixed by #8664 or #10996
Open

Continue comments #1730

antoyo opened this issue Mar 3, 2022 · 6 comments · May be fixed by #8664 or #10996
Labels
A-helix-term Area: Helix term improvements C-enhancement Category: Improvements

Comments

@antoyo
Copy link
Contributor

antoyo commented Mar 3, 2022

Hi.

Describe your feature request

I'd like a feature like vim's setting formatoptions=ro, that is something that will continue a comment when you press Enter in insert mode or open a new line inside a comment.

Thanks!

@seanchen1991
Copy link

This is a feature that I'm quite sorely missing. I'd love to see it get merged soon!

@antoyo
Copy link
Contributor Author

antoyo commented Dec 22, 2022

I'll see if I can cleanup this PR in January. I've been quite busy lately.

@icefoxen
Copy link

Not the same, but related: using J to join lines in comments leaves the stray comment markers in the line. So if I have:

// foo
// bar

and I hit J in normal mode I get:

// foo// bar

Interestingly, :reflow handles both cases correctly.

@dist1ll
Copy link

dist1ll commented Jul 26, 2023

A note regarding the implementation: vim also carries over the preceding whitespace of the current comment line.

/* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do 
 * eiusmod tempor incididunt ut labore et dolore magna aliqua.
 *
 *       push   %rax
 *       jmpq   *%rax▎
 *       ▎           ^ 
 */      ^       if you press enter here
       cursor
     lands here 

This is very useful when writing comments with varying levels of indentation.

@bluthej
Copy link

bluthej commented Dec 7, 2023

I'm also very excited about this feature! Just to get an update, if I understand correctly #8664 should do the trick (at least for line comments) but it's waiting on #4718 to get merged is that right?

@the-mikedavis
Copy link
Member

Yep that's correct, we want to get in #4718 first and then look at #8664

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-enhancement Category: Improvements
Projects
None yet
7 participants