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

Item Option highlight group and concealing #2885

Closed
Kayzels opened this issue Feb 21, 2024 · 3 comments
Closed

Item Option highlight group and concealing #2885

Kayzels opened this issue Feb 21, 2024 · 3 comments

Comments

@Kayzels
Copy link

Kayzels commented Feb 21, 2024

Is your feature request related to a problem? Please describe it.
Not a problem as such, just something I've noticed. I use the description environment a lot when writing LaTeX. That uses the \item[value] syntax. That is, it provides an optional argument to the \item command. At the moment, with \item concealed, it looks a bit strange.

For example:
\item[Corrective Maintenance] In response to system errors.
looks like
○[Corrective Maintenance] In response to system errors.

It's not really a problem, but it feels squished. And because the word in [] is typically important, I'd love to be able to change how it looks.

Describe the solution you'd like
Preferably, I'd like to be able to change the way that the argument in […] looks. For example, make it bold, or change its color. That would be possible through a highlight group that targets it. Even better, although I imagine its trickier, I'd like to be able to see the text in the […] but conceal the […] to just show the text. That was possible for arguments in custom commands.

Describe alternatives you've considered
I tried defining item as a custom command in g:vimtex_syntax_custom_commands. I set it to have no argument, and opt to true. I was able to change the concealchar, but the highlight groups I expected to be defined didn't exist. From my understanding, if this worked, then texCmdCItem and texCItemOpt should exist.

Is what I'm looking for possible?

lervag added a commit that referenced this issue Feb 22, 2024
@lervag
Copy link
Owner

lervag commented Feb 22, 2024

I think I pushed an update that fixes this, please update and test.

image

@lervag lervag closed this as completed Feb 22, 2024
@Kayzels
Copy link
Author

Kayzels commented Feb 23, 2024

I can confirm that it works. Thank you.

@lervag
Copy link
Owner

lervag commented Feb 23, 2024

Great, glad to hear it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants