tamton-aquib / staline.nvim

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

Not an issue per say but is there a way to set the whole/partial path for the file name in the mid section? #38

Closed MadoScientist97 closed 2 years ago

MadoScientist97 commented 2 years ago

This becomes a problem if we are editing multiple files of the same name. Cant see the path under which the file is at a quick glance. Is there an option for that?

tamton-aquib commented 2 years ago

Heyyo @MadoScientist97 , are you looking for the full_path option inside setup.defaults?

MadoScientist97 commented 2 years ago

Yeah I got that. But then I remembered why I turned it off. When the paths are too long the other sections gets pushed. I am now trying to modify the full path version so that you can specify a max char length (or maybe have a % based limit based on window size) after which it will start compressing the string ala starship prompt.

tamton-aquib commented 2 years ago

Ah right, i understand Theres no conditional section rendering right now, but we could emulate it like:

require("staline").setup {
    sections = {
        mid = {
            { 'Staline', function()
                return vim.o.columns <= 60 and '%f' or '%F'
            end }
        },
     }
}

But in this case, we lose the icon, and will have to manually add it.

Or the inner parsing function can be improved a bit to check if the return value of the function is one of the predefined section 😅

MadoScientist97 commented 2 years ago

If I do make it similar to starship I'll do a pull request, you can decide if you want to add it. When I'll get to it though, I can't say. 😅

tamton-aquib commented 2 years ago

I dont know how your starship displays path , but if your sending a PR, make sure to do it in dev branch btw 😅

tamton-aquib commented 2 years ago

Closing the issue due to inactivity. Feel free to open if the problem persists. 👍🏻