tamton-aquib / staline.nvim

A modern lightweight statusline and bufferline plugin for neovim in lua.
MIT License
373 stars 16 forks source link

Add LSP client name truncation feature #53

Closed farias-hecdin closed 1 year ago

farias-hecdin commented 1 year ago

Hello! How are you? I created this small functionality for staline.nvim.

I like the lsp_name section, but I had the inconvenience that every LSP client is activated when navigating between different files, causing the lsp_name list of names to grow and grow, ruining the appearance of staline.

My solution was to add the lsp_client_character_name option to the configuration file and expand the features of lsp_name, so that by adding a certain value to lsp_client_character_name, the list of names would be truncated and a number indicating how many clients are active would be displayed.

That is:

require('staline').setup {
  defaults = {
    lsp_client_character_name = 12,
    ...
    }
}

With lsp_client_character_name = 0. lsp_name_OFF

With lsp_client_character_name = 12. lsp_name_ON-2

With lsp_client_character_name = 12 when the LSP client is not detected. lsp_name_ON-1

The icon is part of lsp_client_symbol.

What do you think?

tamton-aquib commented 1 year ago

Heyyo @farias-hecdin, good stuff ❤️ .

I will merge in 2 days as Im not at home currently and I cant test. Also if you could change all the casing to snake, it would be great. In the mean time, if you dont encounter any bugs too, let me know 😅

farias-hecdin commented 1 year ago

I corrected some bugs in the functionality. Pardon my mistake. :tired_face:

tamton-aquib commented 1 year ago

Thank you for the PR ❤️

muhrizkiakbar commented 3 months ago

Screen Shot 2024-06-21 at 22 10 42 Bro, i got a error currently i use lsp

tamton-aquib commented 3 months ago

heyyo @muhrizkiakbar, which version of neovim are you on? the requirement secrion was updated recently: #70