-
Notifications
You must be signed in to change notification settings - Fork 407
[RFC] Further concealments: math matrices & envs, alignment character, conceal first space after left delimiter word e.g. \langle #2645
Copy link
Copy link
Closed
Labels
Description
I am evaluating the concealment feature how much I would conceal to increase the readability:
I am trying following:
- Math matrices
- Math environments
\begin{equation|...}andend{equation|...} - Alignment character
& - First space after left delimiter word e.g.
\langle
" Amsmath Matrices
" \begin{Vmatrix|vmatrix|Bmatrix|bmatrix|matrix|pmatrix|smallmatrix} \end{...}
syntax match texCmdEnvM "\\begin{Vmatrix}" contained conceal cchar=║
syntax match texCmdEnvM "\\end{Vmatrix}" contained conceal cchar=║
syntax match texCmdEnvM "\\begin{vmatrix}" contained conceal cchar=|
syntax match texCmdEnvM "\\end{vmatrix}" contained conceal cchar=|
syntax match texCmdEnvM "\\begin{Bmatrix}" contained conceal cchar={
syntax match texCmdEnvM "\\end{Bmatrix}" contained conceal cchar=}
syntax match texCmdEnvM "\\begin{bmatrix}" contained conceal cchar=[
syntax match texCmdEnvM "\\end{bmatrix}" contained conceal cchar=]
syntax match texCmdEnvM "\\begin{pmatrix}" contained conceal cchar=(
syntax match texCmdEnvM "\\end{pmatrix}" contained conceal cchar=)
syntax match texCmdEnvM "\\begin{smallmatrix}" contained conceal cchar=(
syntax match texCmdEnvM "\\end{smallmatrix}" contained conceal cchar=)
syntax match texCmdEnvM "\\begin{matrix}" contained conceal
syntax match texCmdEnvM "\\end{matrix}" contained conceal
" Hide Array
syntax match texMathCmdEnv "\\begin{array}{.\{-}}" contained conceal
syntax match texMathCmdEnv "\\end{array}" contained conceal
" Hide math environments similar to \[ \]
syntax match texMathEnvBgnEnd "\\begin{equation\*\?}" contained conceal
syntax match texMathEnvBgnEnd "\\end{equation\*\?}" contained conceal
syntax match texMathEnvBgnEnd "\\begin{align\*\?}" contained conceal
syntax match texMathEnvBgnEnd "\\end{align\*\?}" contained conceal
syntax match texMathEnvBgnEnd "\\begin{gather\*\?}" contained conceal
syntax match texMathEnvBgnEnd "\\end{gather\*\?}" contained conceal
syntax match texMathEnvBgnEnd "\\begin{aligned\*\?}" contained conceal
syntax match texMathEnvBgnEnd "\\end{aligned\*\?}" contained conceal
syntax match texCmdEnvM "\\begin{alignat\*\?}{.\{-}}" contained conceal
syntax match texCmdEnvM "\\end{alignat\*\?}" contained conceal
syntax match texCmdEnvM "\\begin{empheq\*\?}\(\[.\{-}\]\)\?{.\{-}}" contained conceal
syntax match texCmdEnvM "\\end{empheq\*\?}" contained conceal
" Conceal alignment character
syntax match texTabularChar /&/ conceal
syntax match texTabularChar /&/ contained concealFor the math enviornments and the alignment character I feel like this should be optional and possibly by default turned off.
Currently, only the concealment for sections as markdown/atx formatting is disabled:
Lines 2410 to 2424 in b527d75
| let g:vimtex_syntax_conceal = { | |
| \ 'accents': 1, | |
| \ 'ligatures': 1, | |
| \ 'cites': 1, | |
| \ 'fancy': 1, | |
| \ 'spacing': 1, | |
| \ 'greek': 1, | |
| \ 'math_bounds': 1, | |
| \ 'math_delimiters': 1, | |
| \ 'math_fracs': 1, | |
| \ 'math_super_sub': 1, | |
| \ 'math_symbols': 1, | |
| \ 'sections': 0, | |
| \ 'styles': 1, | |
| \} |
I also have refined the concealment of \langle as following:
" Refined concealment: capture optional space " \?"
syntax match texMathDelim "\\langle\> \?" contained conceal cchar=⟨To understand the motivation consider this part of an equation:
\forall \{i,j;n_k\} \in E(\langle G,n\rangle)and without the refinement it looks like following:

Do you see the additional space after 〈 ?
I am not sure about them yet. I guess time will tell. If others consider them also worthwhile, they could express their interest.
Reactions are currently unavailable
