Skip to content
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

Markdown with vim-pandoc-syntax #207

Closed
iGormilhit opened this issue May 14, 2020 · 12 comments · Fixed by #261
Closed

Markdown with vim-pandoc-syntax #207

iGormilhit opened this issue May 14, 2020 · 12 comments · Fixed by #261

Comments

@iGormilhit
Copy link

I'm trying to use nord-vim, and a lot of things are going very smoothly. But I encounter a small glitch with markdown syntax rendering, when using vim-pandoc and vim-pandoc-syntax. With a solarized light color scheme, for instance, headers are red, and the # is rendered as a §, list like - or * are blue, with a big ·, and so on. But with nord-vim, it goes like this:

nord-vim-pandoc-syntax

Everything is fine, except the grayish surroundings of symbols. Do you think that I can do something about it?

Of course, I cannot just get rid of vim-pandoc-syntax, as it helps vim-pandoc with it's autoformat feature as I'm writing in markdown.

And I don't know if it's a nord-vim or a vim-pandoc-syntax issue.

I'm using neovim 0.4.3. My configuration is on github: https://github.com/iGormilhit/neovim/blob/master/init.vim

@arcticicestudio
Copy link
Contributor

arcticicestudio commented Jun 4, 2020

Hi @iGormilhit 👋, thanks for your contribution 👍

This looks like a encoding problem, but might also be the fact that this requires specific support for the highlighting groups defined by the vim-pandoc-syntax plugin. Regarding the swap of the characters I quickly looked up the plugin source and found a conditional block for character encoding.
Could you please post some details about the terminal you use and also check what's the configured encoding of it?

@iGormilhit
Copy link
Author

iGormilhit commented Jun 4, 2020

@arcticicestudio Thanks for your kind message! Usually I'm using Tilix 1.9.1, with UTF-8 Unicode, if it is the right answer to your question.

Edit: and, just to be sure, the characters are correctly swapped. It's the gayish highlighting that was disturbing my eyes. I must admit that I'm already used to it, now. 😃

@arcticicestudio
Copy link
Contributor

👍 for Tilix 😄
We can test if the highlighting is applied by the plugin. Could you please move your cursor to one of the grayish elements and run echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')? This should print the name of the applied highlighting groups of the element below the current cursor position.

@iGormilhit
Copy link
Author

Hummm, what you mean by " and run echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')?

Where do I have to run this command? I tried in a second tilix frame with no result other than to print what is after the echo. And then, from neovim with :! <your-command> with the following output: zsh:1: no matches found: map(synstack(line(.), col(.)), synIDattr(v:val, "name"))

I think I didn't understood your instruction correctly.

@arcticicestudio
Copy link
Contributor

arcticicestudio commented Jun 4, 2020

These are builtin Vim commands and functions that are also used in Vimscripts (like e.g. plugins), so running it without ! from your Vim prompt should do it:

: echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')

@iGormilhit
Copy link
Author

iGormilhit commented Jun 4, 2020

Ok, then, when the cursor is on a list item, I get : ['pandocUListItem', 'pandocUListItemBullet'].

When the cursor is on a heading : ['pandocAtxHeader', 'pandocAtxHeaderMark', 'pandocAtxStart'].

@arcticicestudio
Copy link
Contributor

Thanks, as I thought these elements are styled through custom syntax highlight groups that are defined by the plugin. When the currently active color scheme doesn't define these the default styles of the plugin are applied which in most cases doesn't visually match the color scheme.

So to align it with Nord we need to explicitly add the highlighting groups. I'll add this issue to the backlog, but feel free to submit a PR 😄

@iGormilhit
Copy link
Author

I'll give a look, but I'm not sure I'll be able to propose anything, sadly. 😉

@arcticicestudio
Copy link
Contributor

Don't stress yourself there, I've added it to the backlog so it'll be implemented later on anyway or maybe someone else picks it up 😊

@BirgerNi
Copy link

BirgerNi commented Jul 9, 2020

These elements are concealed and therefore seems to have the group Conceal. As a workaround putting hi Conceal guibg=NONE ctermbg=NONE in my .vimrc helped for me.

@arcticicestudio Can the Nord color scheme take that into account?

@arcticicestudio arcticicestudio added the hacktoberfest This repository participates in the Hacktoberfest label Oct 8, 2020
@arcticicestudio arcticicestudio removed the hacktoberfest This repository participates in the Hacktoberfest label Nov 13, 2020
@januz
Copy link

januz commented Feb 25, 2021

I ran into this issue today. Are there plans to implement it still?

arcticicestudio added a commit that referenced this issue May 28, 2021
The `Conceal` group was not supported which could have led to rendering
problems for (Unicode) characters that require special encoding like
the ones from the Greek alphabet [1] that are often used in LaTeX [3] or
Pandoc [4] documents. These characters were highlighted with the default
background color which makes them kind of unreadable with the theme
foreground color.
See `:help conceal` and `:help concealcursor` for more details about
concealing in Vim.

To fix the problem, the `Conceal` group has been added with its
background color set to `NONE` for GUI and terminal mode to either use
the terminal default background color or let loaded scripts apply custom
styles based on the current runtime context.

The problem has been reported in GH-149, GH-207 and GH-211 with LaTeX
and Pandoc being used by the reporters. PR GH-220 adds support for
vim-pandoc/vim-pandoc-syntax [5] specific highlighting groups and can be
merged after adding basic support for `Conceal`.

[1]: https://en.wikipedia.org/wiki/Greek_alphabet
[2]: https://www.overleaf.com/learn/latex/mathematical_expressions
[3]: https://www.latex-project.org
[4]: https://pandoc.org
[5]: https://github.com/vim-pandoc/vim-pandoc-syntax

Co-authored-by: Sven Greb <development@svengreb.de>

GH-256
arcticicestudio added a commit that referenced this issue May 28, 2021
The `Conceal` group was not supported which could have led to rendering
problems for (Unicode) characters that require special encoding like
the ones from the Greek alphabet [1] that are often used in LaTeX [3] or
Pandoc [4] documents. These characters were highlighted with the default
background color which makes them kind of unreadable with the theme
foreground color.
See `:help conceal` and `:help concealcursor` for more details about
concealing in Vim.

To fix the problem, the `Conceal` group has been added with its
background color set to `NONE` for GUI and terminal mode to either use
the terminal default background color or let loaded scripts apply custom
styles based on the current runtime context.

The problem has been reported in GH-149, GH-207 and GH-211 with LaTeX
and Pandoc being used by the reporters. PR GH-220 adds support for
vim-pandoc/vim-pandoc-syntax [5] specific highlighting groups and can be
merged after adding basic support for `Conceal`.

[1]: https://en.wikipedia.org/wiki/Greek_alphabet
[2]: https://www.overleaf.com/learn/latex/mathematical_expressions
[3]: https://www.latex-project.org
[4]: https://pandoc.org
[5]: https://github.com/vim-pandoc/vim-pandoc-syntax

Co-authored-by: Sven Greb <development@svengreb.de>

Closes GH-256
@arcticicestudio
Copy link
Contributor

arcticicestudio commented May 29, 2021

@iGormilhit @BirgerNi Thanks for your help 👍
The problem has been documented in #256#261 (⊶ f3f28b9) and will be shipped in version 0.16.0.

Thanks for your patience, the large amount of tasks for the Nord project are really time consuming and free time is kind of rare.

@arcticicestudio arcticicestudio added this to the 0.16.0 milestone May 29, 2021
crispgm pushed a commit to crispgm/nord-vim that referenced this issue Jun 10, 2021
The `Conceal` group was not supported which could have led to rendering
problems for (Unicode) characters that require special encoding like
the ones from the Greek alphabet [1] that are often used in LaTeX [3] or
Pandoc [4] documents. These characters were highlighted with the default
background color which makes them kind of unreadable with the theme
foreground color.
See `:help conceal` and `:help concealcursor` for more details about
concealing in Vim.

To fix the problem, the `Conceal` group has been added with its
background color set to `NONE` for GUI and terminal mode to either use
the terminal default background color or let loaded scripts apply custom
styles based on the current runtime context.

The problem has been reported in nordthemeGH-149, nordthemeGH-207 and nordthemeGH-211 with LaTeX
and Pandoc being used by the reporters. PR nordthemeGH-220 adds support for
vim-pandoc/vim-pandoc-syntax [5] specific highlighting groups and can be
merged after adding basic support for `Conceal`.

[1]: https://en.wikipedia.org/wiki/Greek_alphabet
[2]: https://www.overleaf.com/learn/latex/mathematical_expressions
[3]: https://www.latex-project.org
[4]: https://pandoc.org
[5]: https://github.com/vim-pandoc/vim-pandoc-syntax

Co-authored-by: Sven Greb <development@svengreb.de>

Closes nordthemeGH-256
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants