dracula / vim

🧛🏻‍♂️ Dark theme for Vim

Home Page:https://draculatheme.com/vim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Strange pink highlight in some words - is this by design?

gregth opened this issue · comments

What happened

Some words in vim appear highlighted with pink color. For example, when using Tagbar plugin for go language outline, or at the intro screen of VIM.

What I expected to happen

This highlight is irritating, is this a bug or just a design decision?

Screenshot

At right bottom is the Tagbar with the pink highlights:
image

Another case, at the vim intro screen:
image

The following screenshot is what I get when I run vim without loading plugins, which means with Dracula for vim disabled (still I have Dracula theme for my gnome-terminal enabled):

image

Machine Info

Linux Dellis 4.15.0-142-generic #146-Ubuntu SMP Tue Apr 13 01:11:19 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

  • Vim type (vim/gvim/neovim): vim
  • Vim version: VIM - Vi IMproved 8.0
  • OS: Ubuntu 18.04
  • Terminal/Terminal Emulator/VTE: gnome-terminal
  • TERM environment variable: screen

Hmm, looks like the SpecialKey might be off--do you change that in your config? Could another plugin? Try :verbose highlight SpecialKey

@benknoble you are right! There was a line in my .vimrc that altered the SpecialKey.
I removed the line and now the colors are grey-ish, which makes them quite indistinguishable, is that the expected behavior?

Now I get:

:verbose highlight SpecialKey
SpecialKey     xxx term=bold ctermfg=4 guifg=Blue
                   links to DraculaSubtle
        Last set from ~/.vim/bundle/dracula/colors/dracula.vim

image

Thank you for your help!

Unfortunately for the moment, this is "intended"… due to a quirk (#192 #210 ) that neovim & vim use (slightly) different highlight groups for trailing whitespace, which we would like to be more subtle. Vim uses SpecialKey, which also get's used for stuff like <CR>/etc. (the output of :map is also not-fun if you have special keys). NeoVim, IIUC, uses a different group, so we can style the trailing whitespace separately from the special keys. I think @dsifford uses NeoVim and can give more context on this.

If you really don't like it, one simple fix is

augroup dracula_custom
  autocmd!
  autocmd ColorScheme dracula highlight! link SpecialKey DraculaPink
augroup END

(or whatever your preferred color is)

@benknoble Neovim uses SpecialKey exclusively for non-printable characters and Whitespace for any other whitespace character highlighting (i.e. the listchars)

@dsifford I would like to revisit the issues I linked above at some point (I think #210 is the most relevant). To me it's worth making vim's listchars stuff a little more visible if it makes other UI elements that use the same group easier to deal with. (And, note, vim doesn't use just SpecialKey but NonText for certain elements.)

The other option would be to try to get vim to use a different/new group for list chars (Whitespace?) with PRs/discussion on the source.

Definitely open to making those changes. Happy to put our heads together if you want to get a PR started.

Hi @gregth, I'm looking for feedback on #252, which should help ameliorate that "hard to read grey" in some places. Any thoughts, positive or negative?

I think this is resolved, so I'll close it for now. Let us know if it is not resolved.

@benknoble I apologize, I missed the notification for your mention.
I just pull the latest master commits, and the fix seems good!

Thank you for working on this!