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

feature: Allow multiple highlight colors (expand #255) #306

Closed
1 task done
aarondill opened this issue Aug 2, 2024 · 13 comments
Closed
1 task done

feature: Allow multiple highlight colors (expand #255) #306

aarondill opened this issue Aug 2, 2024 · 13 comments
Labels
enhancement New feature or request stale

Comments

@aarondill
Copy link

Did you check the docs?

  • I have read all the todo-comments.nvim docs

Is your feature request related to a problem? Please describe.

I'd like to highlight the user portion of todo comments in a different color.
For example, in the below, FIXME would be one color, (folke) would be a different, and : something is broken would remain unhighlighted.

--- FIXME(folke): something is broken

Describe the solution you'd like

Accept a list for the color argument. Color each capture group in the regex after the first with it's corresponding color.
For example, the below would accomplish the above highlighting.

{
    keywords = {
      FIXME = {  color = {"error", "user"} }
    },
    colors = {
      error = { fg = "#ff0000" },
      user = { fg = "#ffa500" },
    },
    highlight = {
      pattern = [[.*<((KEYWORDS)\s*(.*)?\s*:)]],
      multiline = false,
      after = "",
      keyword = "bg",
    },
}

Describe alternatives you've considered

  1. reverting to the builtin comment.scm and tree-sitter-comment
  2. Leave it as is.

Additional context

No response

@aarondill aarondill added the enhancement New feature or request label Aug 2, 2024
@aarondill
Copy link
Author

This is similar to the desired result (this is tree-sitter-comment):
2024-08-02_17-34

@Kyren223
Copy link

Kyren223 commented Aug 7, 2024

@aarondill Hey, I am looking for this exact feature, how did u achieve what's in your screenshot?

@aarondill
Copy link
Author

@Kyren223, that screenshot is currently impossible to replicate with this plugin.
If you want exactly that screenshot though, you can uninstall this plugin and install the typescript comment parser via :TSInstall comment

@Kyren223
Copy link

Kyren223 commented Aug 7, 2024

@aarondill ah thx, I might end up forking this, I have wanted to have more customization for a while, like being able to specify both a bg and fg per section per type so I can have have 3 splits or even more for -- |TODO|(kyren)|: |text| (| used to indicate diff sections)
EDIT: and then instead of color = it'd be color = { section = value1, section2 = value2 }

@aarondill
Copy link
Author

if you do, please open a PR to hopefully upstream those changes to the rest of us 😃

Copy link
Contributor

github-actions bot commented Sep 7, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Sep 7, 2024
@aarondill
Copy link
Author

not stale.

@aarondill
Copy link
Author

@Kyren223 did you get anywhere with that?

@Kyren223
Copy link

Kyren223 commented Sep 7, 2024

Currently I mostly use IntelliJ + IdeaVim (as I code in java), and for what I do in NeoVim (docs for the Java project) I don't really need this feature, so I haven't needed it.
I might pick it up if my next project will use something like Rust where nvim is good at.

@github-actions github-actions bot removed the stale label Sep 8, 2024
Copy link
Contributor

github-actions bot commented Oct 8, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Oct 8, 2024
@aarondill
Copy link
Author

a comment a day keeps the stalebot away 😃

@github-actions github-actions bot removed the stale label Oct 9, 2024
Copy link
Contributor

github-actions bot commented Nov 9, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Nov 9, 2024
Copy link
Contributor

This issue was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

2 participants