Misterio77 / flavours

🎨💧 An easy to use base16 scheme manager that integrates with any workflow.
MIT License
506 stars 28 forks source link

Compatible with vim? #18

Closed Diaoul closed 3 years ago

Diaoul commented 3 years ago

I see there is a vim template but I cannot get it to work. I also see that you are not using flavours to change your colorscheme in your dotfiles for vim/nvim. Why not? Although the picture in the README is bad quality, it seems like there is vim in there?

I'd really love some good documentation with a few recipes to get inspiration, I might submit a PR to improve that part. If I can get it to work, that is :laughing:

Diaoul commented 3 years ago

After trying a few things it seems that flavours (and more specifically base16 and their generic approach) doesn't play well with vim as a colorscheme. It's better to use a vim plugin for that.

However is there a way for flavours to be able to change the setting colorscheme in my vimrc? It would probably require a mapping like to translate the gruvbox-dark-medium to gruvbox.

Any advice to help on how to achieve that would be very appreciated :+1:

Misterio77 commented 3 years ago

Hey!

I do theme vim with flavours, but not directly. I just let it use my terminal colors haha. I use the noctu (which is specifically made for working with the 16 colors on any terminal) scheme for this. Here's how it looks like: light dark

So i'm not sure how the vim template actually works. But it does exist, and should work if you want to go that route.

Misterio77 commented 3 years ago

Just for completeness sake, here's how it looks with gruvbox-dark-hard applied: gruvbox

All i do is set noctu scheme on my init.vim, set alacritty (my terminal) to work with flavours, and vim matches it when changed through flavours apply.

I think we should have better documentation about this, but i'm a little bit out of free time right now (semester finals on college). But i do plan on doing it during school break. Feel free to write some, if you'd like! I'm not sure how the wiki works on github, but it could be a nice route.

Diaoul commented 3 years ago

Oh I didn't check what noctu was, I though it was some hardcoded theme name but it relies on terminal colors. Neat :star:

I think I still prefer the complete version of the theme though so I'll workaround this, I think it is unlikely that I will be changing themes that often, I will probably be fine with a handful of them so I don't mind a little manual work here and there as long as I can plug this behavior in flavours for the switching part. :thinking: Maybe noctu could even be used as a fallback if I cannot find the theme in my custom mapping :thinking:

I will continue my road to theming until I have satisfactory results and will see if it it makes sense to use flavours or if I will have to override all themes for all apps anyway for them to look decent :disappointed:

gingkapls commented 3 years ago

I have been using flavours with the base16-vim colourscheme with a few modifications for a while now, it supports tons of stuff and even works with vim-airline (which noctu doesn't support I think) Here is gruvbox-dark-medium with the my my base16-vim template for comparison.

It works pretty good with all the default templates and even generated ones (though it may sometimes not look good if the terminal colours don't have much contrast)

image

Diaoul commented 3 years ago

Yeah it seems base16-vim is unmaintained and would need some love. There are tons of forks out there and I didn't get a chance to review them. What did you change? I'll definitely check your dotfiles! Thanks!

gingkapls commented 3 years ago

What did you change?

Not much actually. I commented the code that checked if the user was running vim in terminal to apply a shellscript since I set my colors another way and this was bloat to me. I also changed the colors_name=base16-{{scheme-slug}} to colors_name=base16-generated because the changing colourscheme name was messing up my limelight and goyo configurations.

Other than that, I only did some minor stylistic changes for Normal, FoldedColumn, Folded, IncSearch, Search, LineNr, CursorLine, CursorLineNr, htmBold, htmlItalic, SpellBad, SpellLocal, SpellCap, and SpellRare highlight groups.

The highlighting group changes are just for my personal taste so you may or may not like them.

I'll definitely check your dotfiles! Thanks!

I'd be flattered, thank you! Let me know if you have any questions or something's not working properly.

Diaoul commented 3 years ago

I'm not sure which part of your config makes that work with airline but I'll give it a shot to see what's going on.

Also this article explains a way to customize themes. I just might do that for the final touches if needed.

gingkapls commented 3 years ago

The base16 template works with airline by default as far as I know

Misterio77 commented 3 years ago

Awesome input (and dotfiles!) guys. Really fun seeing people having flavours on their setups.

gingkapls commented 3 years ago

Awesome input (and dotfiles!) guys. Really fun seeing people having flavours on their setups.

It's because flavours is pretty fun itself! It really simplified my theming process, and made it super easy to combine different wallpapers and schemes or generate new ones.