rakr / vim-one

Adaptation of one-light and one-dark colorschemes for Vim
MIT License
2k stars 197 forks source link

Switching from One to other colorscheme breaks the latter #9

Open fedemp opened 8 years ago

fedemp commented 8 years ago

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

Result:

1473269360

Expected:

1473269373

keremc commented 8 years ago

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

rakr commented 8 years ago

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

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

keremc commented 8 years ago

@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 commented 8 years ago

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.

rakr commented 8 years ago

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.

ghost commented 7 years ago

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.

rumpelsepp commented 7 years ago

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.

rakr commented 7 years ago

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:

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

rumpelsepp commented 7 years ago

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...