lervag / vimtex

VimTeX: A modern Vim and neovim filetype plugin for LaTeX files.
MIT License
5.29k stars 386 forks source link

Use original highlight for concealed text #2942

Closed handcart2034 closed 2 months ago

handcart2034 commented 2 months ago

Description

Hello there, really appreciate this plugin. I am a bit confused about the highlight for concealed texts tho, mainly because of the following comment in #2732,

Conceal displays them in even different colors.

Here is a minimal example on my end,

\documentclass[12pt]{article}

\begin{document}

\( \alpha α \)

\end{document}

Colorscheme is gruvbox-material, here is how it looks without conceal, note both\alpha and the unicode α are in green,

Here is how it looks with conceal, hard to read in some colorschemes,

The reason is that concealed texts are highlighted by Concealgroup instead of their original group such as texCmdGreek. Because of this the suggested method is to hi clear Conceal or link Conceal to Normal group, which makes it look like

At least the text is readable now, but all concealed texts are highlighted as Normal, regardless of the original syntax group.

My question is is it possible to retain syntax group for those cchar's, as suggested by that comment? Thanks for your time.

Steps to reproduce

No response

Expected behavior

No response

Actual behavior

No response

Do you use a latexmkrc file?

No

VimtexInfo

System info:
  OS: macOS 14.1.1 (23B81)
  Vim version: VIM 9.1 (1-350)
  Has clientserver: false

VimTeX project: exp
  base: exp.tex
  root: /Users/~
  tex: /Users/~/exp.tex
  main parser: current file verified
  document class: article
  compiler: latexmk
    engine: -lualatex
    options:
      -verbose
      -file-line-error
      -synctex=1
      -interaction=nonstopmode
    callback: 1
    continuous: 1
    executable: latexmk
  viewer: Skim
  qf method: LaTeX logfile
lervag commented 2 months ago

Hello there, really appreciate this plugin.

Thanks!

I am a bit confused about the highlight for concealed texts tho, mainly because of the following comment in #2732,

Conceal displays them in even different colors.

I can understand the confusion. The thing is, conceals are highlighted uniformly with :help hl-Conceal. There's not much I can do with that; sorry.

My question is is it possible to retain syntax group for those cchar's, as suggested by that comment? Thanks for your time.

No, it's not possible, as far as I know.