lervag / vimtex

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

conceal tilde and hat #2316

Closed aloispichler closed 2 years ago

aloispichler commented 2 years ago

Is there a way to enable conceal for characters with tilde or hat, as x̃, or x̂, say? Or is there a way to configure that on my end, at least for individual letters? Thanks, vimtex is great :-) !

lervag commented 2 years ago

Glad you like it!

Reg. the issue - you need to describe this better. The type of conceal you ask for is supported. Can you show explicitly what you want?

dericktseng commented 2 years ago

From my personal usage, I have noticed that some characters are concealed ( e.g. \hat{y} -> ŷ ) but not \hat{x} -> x̂. I haven't seen \tilde{} or \widetilde{} characters concealed either. Specifically, these are the settings I use:

vim.g.vimtex_syntax_conceal = {
  ['accents'] = 1,
  ['cites'] = 1,
  ['fancy'] = 0,
  ['greek'] = 1,
  ['math_bounds'] = 1,
  ['math_delimiters'] = 1,
  ['math_fracs'] = 0,
  ['math_super_sub'] = 1,
  ['math_symbols'] = 1,
  ['sections'] = 1,
  ['styles'] = 1
}
lervag commented 2 years ago

From my personal usage, I have noticed that some characters are concealed ( e.g. \hat{y} -> ŷ ) but not \hat{x} -> x̂.

For me, the \hat{x} character is not properly displayed. I use a font that displays most symbols very well, so I'm not sure if I agree we should conceal \hat{x} as I am afraid it would look bad for most people.

But feel free to point out any other similar conceals you find missing. I don't mind adding them if I don't see a good reason not to.

I haven't seen \tilde{} or \widetilde{} characters concealed either.

That's a new feature request. Feel free to open it.

Specifically, these are the settings I use: ...

You could simplify that to this:

vim.g.vimtex_syntax_conceal = {
  fancy = 0,
  math_fracs = 0,
  sections = 1,
}

I'll take the liberty of closing this issue.

sisrfeng commented 2 years ago

https://www.compart.com/en/unicode/U+1E90 \ ['Z', 'Ẑ'], \ ['D', 'Ḓ'],

lervag commented 2 years ago

@sisrfeng Please provide a LaTeX example that I can use to verify these.