vim-one icon indicating copy to clipboard operation
vim-one copied to clipboard

Switching from One to other colorscheme breaks the latter

Open fedemp opened this issue 9 years ago • 10 comments

First select one. Then, when I switch to other coloschemes (apprentice, in the screenshots), mostly all syntax coloring is broken.

Result:

1473269360

Expected:

1473269373

fedemp avatar Sep 07 '16 17:09 fedemp

After changing the color scheme, do this: :setfiletype ft (substitute ft with the output of :echo &ft).

keremc avatar Sep 08 '16 09:09 keremc

Hi, thanks for opening this issue. I've investigated this and it seems that it is not a problem that is directly related to he colorscheme, for instance solarized has the exact same problem. This seem to be related to the way Vim applies colorschemes. Nonetheless, I'll this issue open and will try to reduce this side effect. Thanks for you patience in the meantime.

rakr avatar Sep 08 '16 09:09 rakr

@keremc, I was answering when you commented on this issue. Thanks for the tip. What Ive read so far seems to be related to the way Vim handle the hi def link command when the colorscheme is defined.

rakr avatar Sep 08 '16 09:09 rakr

@rakr Yep. It is a result of that and group links surviving highlight clear. You can fix it by making sure you set every group listed in the help pages highlight-groups and group-name from scratch. Don't do, for example, highlight Comment guifg=#5c6370 but do highlight Comment gui=NONE guibg=NONE guifg=#5c6370 guisp=NONE. Link all groups from scratch. Then reload the syntax script. Not worth the hassle IMHO.

keremc avatar Sep 08 '16 09:09 keremc

Disregard my last comment, it doesn't apply in this case. I think you should close this issue. There isn't much you can do to fix it. You can try to reduce the amount of language-specific highlighting rules but I believe that's pretty much all you can do.

keremc avatar Sep 08 '16 16:09 keremc

Taking @keremc recommendation into account, I'm working on a version that reduces the amount of language-specific highlighting rules. I'll push that to another branch from time to time, stay tuned, I'll push it to master once I'm satisfied with the result. So far this is encouraging, some of the glitches that you describe @fedem are gone.

rakr avatar Sep 09 '16 21:09 rakr

An alternative is to use xolox/vim-colorscheme-switcher to switch colorschemes which takes care about this annoyance. Install this plugin (and its dependency xolox/vim-misc) and changing colorschemes is no longer a problem.

ghost avatar Dec 06 '16 17:12 ghost

Just a suggestion; maybe this would fix the problem: https://github.com/jacoborus/estilo Saw this in other vim colorschemes; you define your colors in YAML and the tool generates the VimL code.

rumpelsepp avatar Jan 25 '17 08:01 rumpelsepp

Hi @rumpelsepp, thanks for mentioning this, estilo is an amazing project, the idea is definitely very cool and IMO, it's the best solution of this type (creating a template and generating the colorscheme). I played with it and as a pet project tried to implement my other colorscheme using this (not published on Github yet). I also pushed a PR to support Elixir few months ago.

The features that I am missing which would make me definitely switch to estilo are:

  • the ability to switch between dark and light background with the colorscheme being able to adapt
  • some parameters like support for italic...

I guess that if this kind of feature finds its way into estilo I would happily migrate one, but not yet.

rakr avatar Jan 25 '17 09:01 rakr

This guy here has also a light theme since he switched to estilo. I don't know how he does it, maybe you could have a quick look, since I am not that much used to colorscheme code for vim...

rumpelsepp avatar Jan 25 '17 09:01 rumpelsepp