tamton-aquib / staline.nvim

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

Is there a way to disable staline in Neotree? #51

Closed totordev closed 1 year ago

totordev commented 1 year ago

Hi, I'm trying to setup staline to not show on a Neotree window. Is it possible to do this? If so, how?

tamton-aquib commented 1 year ago

Heyyo @shebangcode,

Are you using a global statusline? (:h laststatus)

If yes, you might have to redefine the left section. Something like(not tested):

-- From issue #50 
require("staline").setup {
    sections = {
        left = {
            function()
              if #vim.tbl_filter(function(b) return vim.bo[b].ft == "neo-tree" end, vim.api.nvim_list_bufs()) > 0 then
                return (" "):rep(require("neo-tree").config.window.width)
              else
                return ""
              end
            end,
            -- Rest of the section
        }
    }
}
totordev commented 1 year ago

Thank you for responding, but no, I do not use a global statusline.

totordev commented 1 year ago

Is there a way to disable the line for just a certain filetype?

tamton-aquib commented 1 year ago

In that case, the closest we can get is special_table in the setup like mentioned in the README.

totordev commented 1 year ago

I have already tried to do so, in this screenshot: Screenshot 2023-06-26 17 22 46 The line still shows up. I'm sorry for bothering you man.

tamton-aquib commented 1 year ago

That should basically show an error. The alternate way to specify the key would be to:

special_table = {
    ["neo-tree"] = {"NeoTree", "some_icon" },
    -- ... rest of the table
}

I'm sorry for bothering you man.

Haha, no problemo!

totordev commented 1 year ago

Do I need to put an icon, or just put a space?

tamton-aquib commented 1 year ago

Anything you want 😅

totordev commented 1 year ago

Nevermind, it works. Thanks!