Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Lightline support #6

Closed
adigitoleo opened this issue Nov 2, 2020 · 12 comments · Fixed by #7
Closed

Add Lightline support #6

adigitoleo opened this issue Nov 2, 2020 · 12 comments · Fixed by #7
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@adigitoleo
Copy link
Owner

There has been some interest in support for airline and lightline, e.g. https://www.reddit.com/r/vim/comments/itqhs9/mellow_a_bglight_theme_and_statusline_combo/gav0m9h?utm_source=share&utm_medium=web2x&context=3.

They are quite popular plugins and it would be nice to support them. This issue is open for discussion about how to do it. I think it could be part of this plugin rather than pushed to the airline/lightline repos, since that might be easier to maintain.

It will be worth checking how others have done this, e.g.:

Other examples/templates welcome.

@adigitoleo adigitoleo added enhancement New feature or request help wanted Extra attention is needed labels Nov 2, 2020
@toniz4
Copy link
Contributor

toniz4 commented Nov 2, 2020

I could be done how selenized does, it is simpler, but i think there would not be compatible with notermguicolors.

Or airline#themes#get_highlight can be used to get the User values in the airline theme, as you suggested in the reddit comment, so if you update the main theme, it's not needed to update the airline theme.

think it could be part of this plugin rather than pushed to the airline/lightline repos, since that might be easier to maintain.

Yes, i think now they are not taking new themes, after they developed a way for getting themes from other repos.

I'm trying to come up with a lightline theme based on your statusline.

@toniz4
Copy link
Contributor

toniz4 commented Nov 2, 2020

I made a prototype for the lightline light theme, what do you think? I based the colors from the mellow statusbar.
insert
normal
visual

@adigitoleo
Copy link
Owner Author

I could be done how selenized does, it is simpler, but i think there would not be compatible with notermguicolors.

Indeed it looks simpler, and I'm not too concerned with supporting notermguicolors. Even the main themes only have rudimentary support for it.

Or airline#themes#get_highlight can be used to get the User values in the airline theme, as you suggested in the reddit comment, so if you update the main theme, it's not needed to update the airline theme.

Nice, that sounds like a good way to handle colors. I'm not super comitted to the current User colors so let me know if you think they need changes to support this. From the screenshots it looks good to me, but I'm not sure of how many colors lightline/airline needs.

@toniz4
Copy link
Contributor

toniz4 commented Nov 3, 2020

With the lightline theme i just made variables with the 15 terminal colors, i didn't find a way to import those directly from a highlight group or from the theme by itself, so if any colors are updated, the lightline theme has to be updated to. And for the airline theme, i'm not too familiar on how the theme works.

Tomorrow or later i can try making the dark variant. It would be helpful if you can post screenshots of the dark mellow statusbar for reference.

@toniz4 toniz4 mentioned this issue Nov 3, 2020
2 tasks
@adigitoleo
Copy link
Owner Author

I uploaded some screenshots (adigitoleo/vim-mellow-statusline@135095d)

@adigitoleo
Copy link
Owner Author

i didn't find a way to import those directly from a highlight group or from the theme by itself

I think I had the same trouble when looking at this before. Eventually I might refactor to set up the palette in an autoload function, so it can be used by any other plugins.

And for the airline theme, i'm not too familiar on how the theme works

No worries, I preferred lightline as well (and might switch back after this PR if I find mellow-statusline too minimal).

@toniz4
Copy link
Contributor

toniz4 commented Nov 3, 2020

This is the dark lightline theme, what do you think?

Normal Mode:
normal
Replace Mode:
replace
Insert Mode:
insert
Visual Mode:
visual

I don't know if i like the color of the block with the percentage, but let me know what you think.

And another thing, it would be better to have two themes (mellow_dark and mellow_light) or choose them automatically based on the background?

@adigitoleo
Copy link
Owner Author

I don't know if i like the color of the block with the percentage, but let me know what you think.

I see what you mean, it's too close to the backgound color right? It seems that s:blue is only being used for the tabline (TabSel) in those themes, maybe it can also be used for the percentage block?

And another thing, it would be better to have two themes (mellow_dark and mellow_light) or choose them automatically based on the background?

I guess that is what lightline#colorscheme#background() is doing, right? I think it makes sense to choose it automatically based on set bg since the main theme also does this.

Thanks for working on this!

@toniz4
Copy link
Contributor

toniz4 commented Nov 4, 2020

I think using s:blue looks better
2020-11-03-232646_735x740_scrot

I guess that is what lightline#colorscheme#background() is doing, right?

Exactly.

Later it would be possible to shave off some variables, if it was possible to extract the colors directly from a highlight group or a list. The gruvbox theme does something like that.

@adigitoleo adigitoleo changed the title Add Airline and Lightline support Add Lightline support Nov 4, 2020
@adigitoleo
Copy link
Owner Author

Hey, sorry I squashed those commits and merged before you could change to blue color, my bad. I'm still learning the whole git/GitHub thing. I've patched this in for v1.2.1 however.

@toniz4
Copy link
Contributor

toniz4 commented Nov 6, 2020

Oh sorry about that, i forgot to push the commit. That was my bad. But either way it worked out!

@adigitoleo
Copy link
Owner Author

Let me know if there is anything else you wanted to change. Until I find my old lightline setup I'm sticking to mellow-statusline, so that's why I didn't notice this right away :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants