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

Statusline #3

Closed
clason opened this issue Aug 14, 2020 · 31 comments
Closed

Statusline #3

clason opened this issue Aug 14, 2020 · 31 comments
Labels
help wanted Extra attention is needed idea

Comments

@clason
Copy link

clason commented Aug 14, 2020

What?
A convenient and efficient way of configuring the statusline using lua (similar to airline or, in particular, lightline).

Why?
A pure lua plugin would allow more efficient and, in particular, async routines for showing, e.g., git or lsp status.

Potential existing implementations:
https://github.com/tjdevries/express_line.nvim (it's called "express line", it must be fast!)

Potential pitfalls:
Ideally, it would tie in with other lua plugins (Git, LSP). Themability is an open question (could it directly support lightline color schemes)?

@clason clason added help wanted Extra attention is needed idea labels Aug 14, 2020
@wbthomason wbthomason added this to Ideas in Project Ideas via automation Aug 17, 2020
@wbthomason wbthomason moved this from Ideas to In progress in Project Ideas Aug 17, 2020
@Seirdy
Copy link

Seirdy commented Nov 12, 2020

Also see https://github.com/glepnir/galaxyline.nvim

@wbthomason
Copy link
Collaborator

Maybe this can be considered "done" now? @tjdevries @glepnir do you think your implementations are complete per what @clason mentions?

@matu3ba
Copy link

matu3ba commented Dec 25, 2020

Neither appears to support lsp with a meaningful simple/usable setup. Or they are too shy to mention in the README.

@glepnir
Copy link

glepnir commented Dec 25, 2020

@matu3ba hmm what do you mean? galaxyline has provide Lsp Diagnostic support. and you can write your custom provider to implement what you want

@matu3ba
Copy link

matu3ba commented Dec 25, 2020

@glepnir I was thinking about some minimal default like lightline and colorscheme support. Sorry, keep forgetting that diagnostic handles the lsp output.

@glepnir
Copy link

glepnir commented Dec 25, 2020

Neither appears to support lsp with a meaningful simple/usable setup

like you said.
galaxyline regards each area of ​​stautsline as a component, and provides a variety of keywords to provide settings, you can set the color you want for each area. Instead of using some fixed theme colors. galaxyline is a statusline plugin that supports full customization. Its purpose is that users can build their own statusline through their own ideas. For the convenience of users who have no experience in neovim, I have written some default functions, which can realize a statusline by simply calling

@matu3ba
Copy link

matu3ba commented Dec 31, 2020

@glepnir Only drawback I see is missing support of various colorschemes in lua like onehalf or do you know fairly complete ones in lua?

@glepnir
Copy link

glepnir commented Dec 31, 2020

check here ,config colorscheme is not difficult.

@ishan9299
Copy link

@matu3ba my colorscheme modus-theme-vim has support for galaxyline.

@coxackie
Copy link

coxackie commented Jan 3, 2021

What about lualine? I am quite excited about this one...

@glepnir
Copy link

glepnir commented Jan 4, 2021

@coxackie Lualine looks more like airline. It is heavy, galaxyline is more free and light. galaxyline allows you to completely customize any area of ​​the statusline. check here to see users custom statusline.

@coxackie
Copy link

coxackie commented Jan 4, 2021

@glepnir I would not really call it "heavy", to be honest. It is lighter than lightline, at least it feels so, and there are also some metrics by the author. It is true though that it offers more out of the box experience than galaxyline. I would not compare the two directly, but there seems to be space for both to co-exist.

@glepnir
Copy link

glepnir commented Jan 4, 2021

@coxackie You can check our conversation in the reddit post to understand the difference

@clason There were some discussions that were disconnected from the subject. So is it possible to close the issue with lock

@coxackie
Copy link

coxackie commented Jan 4, 2021

@glepnir as far as I can see from the reddit post, you agree with what I mentioned above. I am also not sure what is meant by "discussions that were disconnected from the subject". Do you mean my reference to lualine? Can you be more specific? I do not see any comment above that is out of topic, really.

@hoob3rt
Copy link

hoob3rt commented Jan 6, 2021

I don't know what you mean by "heavy". I consider something heavy in vim when it slows it down, not when it's a few kb bigger in size. FYI here is startup time performance of a few plugins. I was surprised that galaxyline was slower than vimscript plugins.

galaxyline.nvim.git	5.791   
vim-airline.git	        3.896   
lightline.vim.git	2.171   

While lualine loads in 0.1ms as seen in lualine repo

@glepnir
Copy link

glepnir commented Jan 6, 2021

your benchmark is in interest ing. I already test it startuptime is 0. 5

@glepnir
Copy link

glepnir commented Jan 6, 2021

you need use lua profile to test it.

@hoob3rt
Copy link

hoob3rt commented Jan 6, 2021

Could you provide a way to use lua profile inside neovim?

@glepnir
Copy link

glepnir commented Jan 6, 2021

It is in our plan. I will push my test bench mark scripts when i have time

@hoob3rt
Copy link

hoob3rt commented Jan 6, 2021

Okay, thank you :)

@glepnir
Copy link

glepnir commented Jan 7, 2021

@hoob3rt your benchmark has some problem. check this profiler .
image

Looking at the profiler, you can see that the core loading time of galaxyline is only 0.0014ms, and the other time is spent on some providers, most of which is diagnostic. The built-in galaxyline provides diagnostic support for nvim lsp and some other functional support, galaxyline does not depend on Many plug-ins, so in order to enable more users who do not understand lua and vimapi to easily define their own status bar, I wrote many providers. If you remove all of their functions and implement them yourself.

when I only remove diagnostic providers ,profile galaxyline with other providers . Other providers may not consume as much startup time as diagnostic, but I implemented a builtin function for obtaining git branches. It does not depend on git commands or plugins. It is a complex provider. Even so, galaxyline takes about the same time as lualine.
image

Only load the core of galaxyline, which has only about 200 lines of code. Then it will be super fast. But this raises the requirements for users. I will not do this, I hope to provide builtin support instead of depend on any plug-ins

image

Looking at lualine. yes.It seems that there is little time. Looking at the code, lualine provides support through the use of many plug-ins. The default code is very simple. Maybe it is a wrong view to say that it is heavy. But I don't like this approach of relying on plugins. But out of the box is great for some people who don't pursue too much.

Finally, I want to talk about my conclusion, if remove the built-in providers, galaxyline is the fastest, lualine it is a good choice for the out-of-the-box statusline plugin . With reference to this diagnostic, I will implement a more efficient diagnostic on upstream of neovim. Out of the box instead of packaging at the plugin level, it will be very useful for any statusline plugin.

Update 2021-2-4

Now galaxyline async load all the provides This reduces some providers that take special startup time, such as diagnostic providers,

image

@hoob3rt
Copy link

hoob3rt commented Jan 7, 2021

@hoob3rt your benchmark has some problem. check this profiler .

Thank you so much for answering! I will test this profiler myself as well.

Looking at the profiler, you can see that the core loading time of galaxyline is only 0.0014ms, and the other time is spent on some providers, most of which is diagnostic.

I understand that galaxyline's core is really fast but the total loadtime includes diagnostic bottleneck.

Only load the core of galaxyline, which has only about 200 lines of code. Then it will be super fast. But this raises the requirements for users. I will not do this, I hope to provide builtin support instead of depend on any plug-ins

I wouldn't say lualine depends on any plugins, just extends their functionality if the user wants to.

Maybe it is a wrong view to say that it is heavy.

I'm glad you finally agreed :)

With reference to this diagnostic, I will implement a more efficient diagnostic on upstream of neovim. Out of the box instead of packaging at the plugin level, it will be very useful for any statusline plugin.

That's awesome! I would be very grateful if you could tag me when this is implemented. :)

Thank you once again for your detailed reply.

@clason
Copy link
Author

clason commented Jan 7, 2021

And with that, might I suggest we keep the "my statusline is faster than yours" out of this issue? It's enough to introduce your statusline plugin here and (briefly) point out what you think are the strengths; people can come to their own conclusion which tradeoffs they want to make. No reason to make a competition out of it.

(And to the extent that this is "my" issue, I'll only close it once I have found a plugin that I start using myself. This has not happened yet.)

@beauwilliams
Copy link

I am currently working on a lua statusline. Want it to be fast and minimal config. If anyone wants to join in or take a look would be much appreciated. This is first time for me trying to write an extension as exercise in writing lua. There is a lot of work to be done, and its nothing special right now :) https://github.com/beauwilliams/statusline.lua

@beauwilliams
Copy link

I have done a fair amount of work to refactor and clean the codebase up for statusline.lua

Let me know what you guys think. I want this to be light, dependency-free-as-possible and little effort to configure if any. https://github.com/beauwilliams/statusline.lua

@shadmansaleh
Copy link

With all these statuslines how come this isn't granted yet ?

@matu3ba
Copy link

matu3ba commented Mar 28, 2021

With all these statuslines how come this isn't granted yet ?

async routines for showing, e.g., git or lsp status.

@clason Can you specify exactly what you want in your statusline?

@famiu
Copy link

famiu commented Apr 19, 2021

Give feline a try. It's not async but it allows you to easily configure your own statusline.

@windwp
Copy link

windwp commented Jun 9, 2021

@clason
https://github.com/windwp/windline.nvim
my statusline can change status by filetype

@clason
Copy link
Author

clason commented Jun 12, 2021

I think that's enough Lua status lines for now ;)

@clason clason closed this as completed Jun 12, 2021
Project Ideas automation moved this from In progress to Granted wishes Jun 12, 2021
@clason
Copy link
Author

clason commented Aug 25, 2021

For the record, in the end I went for https://github.com/shadmansaleh/lualine.nvim. The main draw for me was the clean configuration in Lua.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed idea
Projects
Project Ideas
  
Granted wishes
Development

No branches or pull requests