-
Notifications
You must be signed in to change notification settings - Fork 393
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
Improve glossaries-extra and bib2gls support #3073
Comments
Thanks for the kind words! I'm happy to hear it is useful to you! And sorry for the long delay in answering your issue! I've started to look at the syntax part now. I'll consider the context menu after. |
Regarding the highlightings; in my opinion, we should not apply spellchecking in the arguments for the |
Please update and test if the syntax highlighting works as expected for you now. Notice, the support for the glossaries package is still very incomplete, so feel free to open further issues on this. But please note that it helps a lot of if you provide concrete examples and "definition" of the commands you want highlighted (e.g. you could copy the relevant section from the docs of the glossaries package). I prefer actual text instead of screenshots, because it is easier for me to copy. |
And there's the initial support for the context menu for glossaries-extra. Please test and let me know how it works for you. |
@lervag Yes, you're absolutely right about the syntax highlighting and spellchecking, I guess I worded it wrong. Speaking of commands, is it possible to use this file https://github.com/lervag/vimtex/blob/master/autoload/vimtex/complete/glossaries to get the list of commands? As far as I know, some of the commands may overlap with commands from other packages, but I think it is safe to add the syntax rules for each I've looked through the manual and I'm not sure it's really possible to add rules for each command, as there are about 500 or 600 of them. By the way, the context menu seems to work great — really handy tool, I've been trying to find some edge cases but haven't found any at the moment. Cay I ask a question: is it possible to make the context menu open the entry in the new split? Thank you very much for your efforts! |
Yes and no; the point is that, for proper highlighting, I need the syntax as well. I.e., I need to know if there are optional arguments and how many arguments each command takes. Now, I think the best approach is simply that you let me know if you come over any command that you find yourself using that you don't think is properly highlighted. Look that (or those) command(s) up and give me a quick definition and an example or two. If you do that, then it should be relatively quick for me to add it.
I never aim for perfect, only good enough. Let's only consider commands that you are actually using.
Great, glad to hear it!
Yes. Now it is. :)
My pleasure! |
@lervag I see, that's understandable. I'll try to make the list of commands over time and share it with you. Maybe I'll try to make a pull request with the appropriate changes myself. |
Hello, first of all I'd like to give you my gratitude for developing and maintaining this plugin. I've been using it for almost 4 years and have created hundreds of documents using it.
Is your feature request related to a problem? Please describe it.
Currently bib2gls and glossaries lack some features:
\cite
command.\gls{entry_name}
is not highlighted as a misspelled word and the_
symbol is not highlighted.\Gls{entry_name}
is highlighted as a misspelled word and also the_
symbol is highlighted as an illegal symbol.I have disabled all plugins (so no treesitter) and set
vimtex_syntax_enabled = 1
.If I disable syntax the gls command argument is also highlighted as wrong.
Describe the solution you'd like
It would be really good to have an ability to easily preview and edit bib2gls entries (for some reason, ctags also do not work with these bib files either, not sure why).
The highlighting of illegal symbols is a nice feature, so it would be great if it worked consistently.
Describe alternatives you've considered
I've tried using
vimtex_syntax_custom_cmds
to manually set the argspell (like here #2960 (comment)) and it is working:I've added also the argstyle argument to visually confirm that I've set it right

As you can see, the argspell parameter disables spell checking. The illegal symbol highlighting is disabled by adding the
nextgroup
parameter.It's good as a temporary solution, but I am not sure if it is the right way to do it, because I need to add about 100 commands.
The text was updated successfully, but these errors were encountered: