Switching colorschemes may not restore all highlight groups

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Switching colorschemes may not restore all highlight groups

Nicola
Hi,
sometimes, switching colorschemes seems to "corrupt" some colors and I am
trying to figure out if there's a way around it.

For example, if I start Vim with syntax on and the default color scheme to
edit my vimrc, then `:hi vimCommand` outputs:

    vimCommand     xxx links to Statement

Now, suppose that I switch to a colorscheme that overrides vimCommand
(with something like `hi! vimCommand…`), then I switch back to default.
Say:

    :colo solarized8_dark
    :colo default

Now, `:hi vimCommand` outputs:

    vimCommand     xxx cleared

As far as I see, the original definition is not reinstated because
syntax/vim.vim uses `hi def` rather than simply `hi` (and there are good
reasons for that, I'm told).

Is there a mechanism to permit the definition from the first colorscheme
to be activated again (something like completely deleting some highlight
groups)?

Nicola




--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Switching colorschemes may not restore all highlight groups

Nicola
On 2016-09-06 17:15:35 +0000, Nicola said:

> Hi,
> sometimes, switching colorschemes seems to "corrupt" some colors and I am
> trying to figure out if there's a way around it.
>
> For example, if I start Vim with syntax on and the default color scheme to
> edit my vimrc, then `:hi vimCommand` outputs:
>
>     vimCommand     xxx links to Statement
>
> Now, suppose that I switch to a colorscheme that overrides vimCommand
> (with something like `hi! vimCommand…`), then I switch back to default.
> Say:
>
>     :colo solarized8_dark
>     :colo default
>
> Now, `:hi vimCommand` outputs:
>
>     vimCommand     xxx cleared

Ok, I have found this: https://github.com/altercation/solarized/issues/102
So this seems a long-standing issue.

Btw, what causes vimCommand to be cleared? I thought it was `:hi clear`.
But if I execute `:hi clear` manually, the highlight group is not cleared:

vim -u NONE
:syntax on
:e ~/.vimrc
:hi clear
:hi vimCommand

It's still linked to Statement. Why is that?

Nicola


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.