nvim-lua / lsp-status.nvim

Utility functions for getting diagnostic status and progress messages from LSP servers, for use in the Neovim statusline
MIT License
625 stars 41 forks source link

[Documentation] Suggestion integration with other status line plugins? #7

Closed nymann closed 4 years ago

nymann commented 4 years ago

Is it worth documenting how to integrate status line with third party plugins such as vim-airline, lightline and a "write it yourself" status line?

Rationale would be that some (a lot?) of people are used to working out of the box status line plugins such as vim-airline, and might be confused to how to integrate it?

But on the other hand, this might be out of the scope of this plugin to provide this (trivial I would assume for more experienced Vim users?) info, let me know what you think. :smile:

nymann commented 4 years ago

After additional thought, I think this is a bad idea. The documentation of how to add custom functions to your status line should be documented by the 3rd party plugin provider. The upkeep of documentation when changes to the 3rd party plugin breaks our documentation alone is too much of a hassle.

teto commented 4 years ago

@nymann or anyone if you have a vim-airline working config, I would still be very happy to copy/paste it into my own :)

wbthomason commented 4 years ago

I'd also be happy to add such a config to the repo if anyone has one.

@teto: Was the sketch I sent you on Gitter not quite right?

dlukes commented 4 years ago

In case it's helpful to anyone, here's what I ended up doing for airline.

One tricky bit was that the default status_symbol can mess up the width of the statusline (not sure if it's airline's fault or my terminal's, didn't investigate further), which results in broken absolute and relative line numbers if you place the lsp-status part before airline's Z section, where the line numbers are. So you may need to use a different symbol or place the lsp-status part after airline's Z section (or both, as I did in the config linked above).

serhez commented 3 years ago

I would love to see some config for lightline! I've been trying myself but I'm not satisfied at all with how I have been able to implement this integration.

pyrho commented 3 years ago

@serhez You can take a look at my config over here for lightline (using the bit provided in the readme) (LspStatus being the function defined in the README, put that somewhere too).

Make sure you have a call to autocmd User LspDiagnosticsChanged call lightline#update() somewhere in your config for it to update properly.

spywhere commented 3 years ago

Just for the future reference, here's my plugin on integrating neovim's LSP diagnostic with lightline:

https://github.com/spywhere/lightline-lsp

serhez commented 3 years ago

Just for the future reference, here's my plugin on integrating neovim's LSP diagnostic with lightline:

https://github.com/spywhere/lightline-lsp

Thanks for this!