nordtheme / vim

An arctic, north-bluish clean and elegant Vim theme.
https://www.nordtheme.com/ports/vim
MIT License
2.52k stars 274 forks source link

Markdown with vim-pandoc-syntax #207

Closed iGormilhit closed 3 years ago

iGormilhit commented 4 years ago

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 commented 4 years ago

Hi @iGormilhit :wave:, thanks for your contribution :+1:

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 commented 4 years ago

@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. :smiley:

arcticicestudio commented 4 years ago

👍 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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

arcticicestudio commented 4 years ago

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 commented 4 years ago

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?

januz commented 3 years ago

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

arcticicestudio commented 3 years ago

@iGormilhit @BirgerNi Thanks for your help :+1: The problem has been documented in #256 ⇄ #261 (⊶ f3f28b93) 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.