Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stabline]: Show multiple buffers per tab #60

Closed
bogdan-the-great opened this issue Mar 6, 2024 · 11 comments
Closed

[stabline]: Show multiple buffers per tab #60

bogdan-the-great opened this issue Mar 6, 2024 · 11 comments

Comments

@bogdan-the-great
Copy link

Hi! Great plugin, but there doesn't seem to be an option to show all buffers belonging to one tab in the stabline at the time.

Two buffers in the same tab (vsplit):
image

Two buffers in two different tabs or any number of buffers in one tab:
image

Nvim version: v0.9.5, using lazy.nvim

config
    {
        "tamton-aquib/staline.nvim",

        config = function()
            require('staline').setup({
                defaults = {
                    expand_null_ls              = false, -- This expands out all the null-ls sources to be shown
                    left_separator              = "",
                    right_separator             = "",
                    full_path                   = false,
                    line_column                 = "%p%% [%l/%L]", -- `:h stl` to see all flags.

                    fg                          = "#000000",      -- Foreground text color.
                    bg                          = "none",         -- Default background is transparent.
                    inactive_color              = "#303030",
                    inactive_bgcolor            = "none",
                    true_colors                 = false,  -- true lsp colors.
                    font_active                 = "none", -- "bold", "italic", "bold,italic", etc

                    mod_symbol                  = "  ",
                    lsp_client_symbol           = " ",
                    lsp_client_character_length = 12, -- Shorten LSP client names.
                    branch_symbol               = "",
                    null_ls_symbol              = "", -- A symbol to indicate that a source is coming from null-ls
                },
                mode_icons = {
                    n = "N",
                    i = "I",
                    c = "C",
                    v = "V", -- etc..
                },
                sections = {
                    left  = { '-mode', 'left_sep_double', 'branch', 'lsp' },
                    mid   = { '' },
                    right = { 'file_name', 'right_sep_double', '-line_column' },
                },
                inactive_sections = {
                    -- left  = { 'branch' },
                    -- mid   = { 'file_name' },
                    right = { 'line_column' }
                },
                lsp_symbols = {
                    Error = " ",
                    Info = " ",
                    Warn = " ",
                    Hint = "",
                },
            })

            require('stabline').setup {
                style       = "bar", -- others: arrow, slant, bubble
                stab_left   = "┃",
                stab_right  = " ",

                -- fg       = Default is fg of "Normal".
                -- bg       = Default is bg of "Normal".
                inactive_bg = "#1e2127",
                inactive_fg = "#aaaaaa",
                -- stab_bg  = Default is darker version of bg.,

                font_active = "bold",
                exclude_fts = { 'NvimTree', 'dashboard', 'lir', "Alpha" },
                stab_start  = "", -- The starting of stabline
                stab_end    = "",
                numbers     = nil
            }
        end
    }

@tamton-aquib
Copy link
Owner

Heyyo @piotr-marendowski,

You might be looking for something like this: https://github.com/tiagovla/scope.nvim ?

@bogdan-the-great
Copy link
Author

Heyyo @piotr-marendowski,

You might be looking for something like this: https://github.com/tiagovla/scope.nvim ?

I do have scope.nvim installed, but it works with my current bufferline in that way that it shows all the buffers opened in the current tab, not only buffers that are in the windows. Without scope.nvim it shows all the buffers from all tabs (even buffers from another tabs and buffers not in the windows).

I would like it work in a similar way as shown in this screenshot (show all buffers and tabs would be nice addition too):

image

@tamton-aquib
Copy link
Owner

tamton-aquib commented Mar 7, 2024

Hi @piotr-marendowski,

I'm not understanding, probably because im not a native english speaker 😅 .

  • By default, all buffers are shown from all tabs. (hence its a bufferline)
  • If scope.nvim is installed, only tab local buffers are shown.

And i didnt understand the screenshot too, can you clarify further?

@bogdan-the-great
Copy link
Author

Hi @piotr-marendowski,

I'm not understanding, probably because im not a native english speaker 😅 .

* By default, all buffers are shown from all tabs. (hence its a bufferline)

* If scope.nvim is installed, only tab local buffers are shown.

And i didnt understand the screenshot too, can you clarify further?

Okay, sorry let me rephrase this.

  1. I have opened a couple of buffers (files) and it shows only one, because there is only one on the screen:

image

  1. Now I have created a vertical split with one of these buffers:

image

What I want is it to display all buffers opened in the first example, not only the one visible, like in bufferline.nvim.

P.S. With or without scope.nvim it works the same way for me.

@tamton-aquib
Copy link
Owner

@piotr-marendowski,

Oh that seems odd. Could you check the value of hidden? (by :set hidden?)

It is usually turned on by default.

@bogdan-the-great
Copy link
Author

bogdan-the-great commented Mar 7, 2024

@piotr-marendowski,

Oh that seems odd. Could you check the value of hidden? (by :set hidden?)

It is usually turned on by default.

I have hidden = false in my config. Turning it on and off (true and false) doesn't change anything.

@tamton-aquib
Copy link
Owner

Maybe some plugins might be overrding it.

Can you try to reproduce it with a minimal config?
Or if you have your config on github, I could take a look.

@bogdan-the-great
Copy link
Author

You are indeed right, I tried lazy.nvim's minimal config and it worked just fine. The option hidden = false was to blame, I set it to true, and I see mostly normal behaviour. But when I open a session (I use possession.nvim) I need to scroll through all the buffers in order to see them all, like they would be hidden at start.

Also when I open a lot of buffers and scroll through them the bufferline (stabline) doesn't move to show their filenames:
image

@tamton-aquib
Copy link
Owner

I set it to true, and I see mostly normal behaviour

That's great to hear!

Also when I open a lot of buffers and scroll through them the bufferline (stabline) doesn't move to show their filenames:

Hmm, that is weird, I'll get on it this weekend 👍🏻

@tamton-aquib
Copy link
Owner

Hi @piotr-marendowski,

I have sent a fix.
If you have time, update and let me know if it works.

@bogdan-the-great
Copy link
Author

Hi @piotr-marendowski,

I have sent a fix. If you have time, update and let me know if it works.

Now it works! Thank you! Now I won't be needing any bufferline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants