-
Notifications
You must be signed in to change notification settings - Fork 391
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
highlight #2732
Comments
So, you want some specific list of utf8 symbols to be highlighted as the corresponding group for the corresponding command? More or less these:
Do I understand correctly? |
Following your table for conceal, For Greek letters: I do understand that this is making too great demands, and just for a niche. |
I've made an attempt at this that I think comes close (or even hits the spot). Please update and test. Let me know if you find any problems or unexpected behaviour due to this. Also; greetings back! Trondheim is not the worst place to be these days - welcome back :) |
Very helpful, indeed. So far, behavior as expected. Thank you! |
Great; let me know if you find any unexpected inconsistencies. :) |
Would it be possible to make this feature toggleable? I find that it leads to inconsistent highlighting, as can be seen in the following image: In the first example, all four functions are highlighted in the same way. But in the second line, one of them is highlighted differently for no apparent reason. (Until I found this GitHub issue, I actually assumed that this was a bug.) One of the advantages of direct Unicode input is that one doesn’t need to rely on TeX commands, which allows for a more consistent look and feel of the code, including consistent code highlighting. Adjusting the highlighting of part of the code to something that it specifically isn’t (namely a TeX command) strikes me personally as more of an anti-feature. So I think it would be good if it could be disabled by the user. I can also open a new issue, if this is more appropriate. |
This was implemented in this function: vimtex/autoload/vimtex/syntax/core.vim Lines 2050 to 2062 in 877de3b
Notice that it will match greek unicode letters as |
For me, this is just fine. Thanks! |
I was personally okay with the behaviour before 7bf2a74, so putting all the Unicode highlighting behind an option should be fine for me. I think the “proper” solution to highlighting Unicode characters would be to highlight them depending on their semantics:
But this is probably far too much work, as not many people use direct Unicode input. (I don’t know how many people use conceal.) |
Cool, I'll add an option for this, then.
Yes, I agree that this is a better solution, but I also agree it is quite a lot of work, and I'm not interested in doing it myself. I wouldn't mind a PR if anyone did the work, though. |
I need to specify a default value here. I'll choose default true, since that is the defacto current value. Thus, if you want to disable, you need to add let g:vimtex_syntax_match_unicode = v:false or, in Lua, vim.g.vimtex_syntax_match_unicode = false |
Thanks, that works for me. |
Thank you! |
Hello again,
Thanks for vimtex.
Vimtex does a pretty nice job in highlighting math formulae and parts of these.
Highlight groups include
<texMathSymbol>
,<texMathCmd>
,<texCmdGreek>,
etc., for example in the formula$\int\alpha(x) dx$
. Conceal displays them in even different colors.XeLaTeX or LuaLaTeX allow inputting these formulae directly, as
$∫α(x) dx$
; however, without highlighting.Would it be possible to have the same highlighting? An implementation might follow the conceal-dictionary… Thanks!
The text was updated successfully, but these errors were encountered: