tamton-aquib / staline.nvim

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

If added lsp and treesitter #5

Closed ashincoder closed 3 years ago

ashincoder commented 3 years ago

Hello I love the plugins of it's minimalism. If the lsp and treesitter things are added will add it to StarVim

tamton-aquib commented 3 years ago

Heyyo @ashincoder, sorry for the inconvenience and late reply 😅 ,

As said in the cons section of readme, this statusline doesn't come with lsp stuff by default. But defaults.cool_symbol and defaults.filename_section can take custom modules. An easy way would be to define a function which returns a string, and pass it to the above said sections.

For Example,

function Lsp_stuff()
    local get = vim.lsp.diagnostic.get_count
    local signs =
    "  "..get(0, 'Error')..
    "  "..get(0, 'Warning')..
    "  "..get(0, 'Information')..
    " " ..get(0, 'Hint')

    return signs
end

And then pass it to, say defaults.filename_section

require'staline'.setup{
    defaults = {
        filename_section = "%{luaeval('Lsp_stuff()')}"
    }
}

Which would look something like:

example_lsp

ashincoder commented 3 years ago

Yeah thanks.

ashincoder commented 3 years ago

It would be great if those were added. Right

tamton-aquib commented 3 years ago

You mean add inside the plugin?

ashincoder commented 3 years ago

Yeah

tamton-aquib commented 3 years ago

Oh, I think leaving this to the user would be better 😅.

Maybe I'll add this in beta branch.

ashincoder commented 3 years ago

yeah great