-
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
Add conceal for \lvert, \rvert... #2186
Comments
Done. |
A package named physics provide the macro |
And I think syntax match texCmdAccent "\\i\>" conceal cchar=ı
syntax match texCmdAccent "\\j\>" conceal cchar=ȷ is correct, just like |
How about syntax match texCmdAccent "\\lq\>" conceal cchar=`
syntax match texCmdAccent "\\rq\>" conceal cchar=' ? Maybe punctuations can be concealed. |
I assume you mean |
Oh, I see. Vim' conceal seems to be able to support only one character. Thanks! |
Yes, precicely. I could conceal the initial |
I found |
Yes, no problem. I've added it as a "fancy" conceal. |
In tex,
will output
I notice double quotes has been concealed in vimtex:
How about others? |
And in tex, |
I'm not sure. I don't think we should aim for "full rendering". I might agree that |
I agree with you. If some of them are not easy to be realized and no one like these macros, support them are not valuable. However, if something don't be supported, the document should explain which macros aren't supported and why them are not supported to avoid some one has any confusion about them. Thanks! |
Sorry, but I don't agree. There are way too many elements that could be concealed to document every element that we don't conceal. My approach so far has been to be pragmatic - if someone suggests something that should be concealed and where I agree it has value, I try to add it. In some cases I say no, either because of complexity or because I don't see the value. If I were to document every decision it would i) make the documentation more bloated, and ii) add to the already high workload of maintaining VimTeX. I would not mind considering PR's, though. Perhaps I'm wrong about i) and it could be possible to add these things to the docs in a good way. But I will personally prioritize other activities that I believe brings more value to the community. |
Thanks for your explanation. Add some not complex and valuable function is the true duty. So just add some necessary conceal is enough. So, can it be supported? Thanks! diff --git a/autoload/vimtex/syntax/core.vim b/autoload/vimtex/syntax/core.vim
index 333e140a..22801934 100644
--- a/autoload/vimtex/syntax/core.vim
+++ b/autoload/vimtex/syntax/core.vim
@@ -1828,9 +1828,13 @@ function! s:match_conceal_accents() abort " {{{1
syntax match texCmdLigature "\\ss\>" conceal cchar=ß
syntax match texLigature "--" conceal cchar=–
syntax match texLigature "---" conceal cchar=—
+ syntax match texLigature "`" conceal cchar=‘
+ syntax match texLigature "'" conceal cchar=’
syntax match texLigature "``" conceal cchar=“
syntax match texLigature "''" conceal cchar=”
syntax match texLigature ",," conceal cchar=„
+ syntax match texLigature "!`" conceal cchar=¡
+ syntax match texLigature "?`" conceal cchar=¿
endfunction |
I'm not so sure about concealing the |
Thanks. Maybe can try |
What do you mean? Reg.
my point was that I believe these conceals may be confusing to the user. Perhaps I'm wrong. If you disagree and still think these will be useful, then OK, I'll add them. |
I'm not offensive... I want to know which situation these conceals will be confusing? Did you mean any code like let g:vimtex_syntax_conceal = {'ligature': 0} By default, it is disabled. If anyone know what these ligature means, they can enable it by themselves. It should not effect too many people, I think. |
I also don't think these conceal will be used by many people especially who don't use any languages containing ligatures. However, Knuth designed them in Tex, so they looks like a standard (albeit not many people know and use). If provide an option to respect standard may be better. That is my opinion. No offend. |
No offense taken, and I hope I don't come off as offensive myself - that is not my intention!
No, currently, this is enabled by default and is provided under the
Again, no offense. I just want to think things through before I implement them. But OK, I'll add the suggested conceals as well together with the new |
Thanks for your explanation. I support this change. |
Describe the solution you'd like
e.g.
test
$$\lVert \mathrm{w} \rVert_2^2$$
The text was updated successfully, but these errors were encountered: