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

Support for block comments #1505

Closed
k2d222 opened this issue Jan 13, 2022 · 6 comments · Fixed by #4718
Closed

Support for block comments #1505

k2d222 opened this issue Jan 13, 2022 · 6 comments · Fixed by #4718
Labels
A-helix-term Area: Helix term improvements C-enhancement Category: Improvements

Comments

@k2d222
Copy link
Contributor

k2d222 commented Jan 13, 2022

Add support for block comments. (line comment support per language was added in #463)

There are multiple use-cases for this:

  • Many languages don't support line comments but do support block comments, e.g. html/xml, css, old c, ocaml. the toggle_comments command could fallback to a multi-line comment.
  • Some users / codebases prefer line comments. That preference could be set in languages.toml.
  • A comment textobject could be interesting too, to select whole comments or comment out selections.
@mikkelfj
Copy link

mikkelfj commented Nov 5, 2022

On a related note - I won't make a new issue for this:

The :reflow command can reformat a selected part of a C block comment of the following style (in my limited testing), but unlike Vim, adding a newline while editing the comment will not add * at the line start, which is rather tedious.

/*
 * foo
 * bar
 */

(this was tested in a .h file with clangd configured as LSP and .h added as a C language extension)

@the-mikedavis
Copy link
Member

That's #1730

@Elias-Graf
Copy link

Is there currently no way to toggle comments in languages like CSS, HTML? I'm (currently) not even talking about having separate shortcuts for block comments, would just be nice if it worked at all in such languages.

@the-mikedavis
Copy link
Member

Correct, this issue covers adding support for toggling block comments

@gabydd
Copy link
Member

gabydd commented Nov 11, 2022

this could be potentially fixed with #4718: heres a video of it in action, its still a draft though and needs a bit of work

@b52es
Copy link

b52es commented Nov 27, 2023

Hi guys! I'm in love with Helix. While I'm learning to program in C, I wrote a commenting utility for Helix. For those who interested, here is the link to the repo.

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
Development

Successfully merging a pull request may close this issue.

7 participants