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

feature: Provide example on how to show tags as tabs #181

Open
1 task done
samueloph opened this issue Nov 28, 2024 · 0 comments
Open
1 task done

feature: Provide example on how to show tags as tabs #181

samueloph opened this issue Nov 28, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@samueloph
Copy link

Did you check the docs?

  • I have read the Grapple docs

Is your feature request related to a problem? Please describe.

I don't use neovim tabs, and I would like grapple tags to behave as if they were tabs, more specifically I would like the setup lualine to show the relpath of each grapple tag as if they were tabs.

Describe the solution you'd like

Similarly to the examples from https://github.com/cbochs/grapple.nvim?tab=readme-ov-file#lualine-component, but for a top bar, listing the relpath of the tags, and highlighting the tag that's in the current buffer (if the buffer is one of the tags).

Describe alternatives you've considered

The closest I could get was using:

tabline = {
                lualine_a = {
                    {
                        function()
                            local tags = require("grapple").tags()
                            if not tags then return "" end
                            local current_buf_path = vim.fn.expand('%:p')
                            return table.concat(vim.tbl_map(function(tag)
                                -- local redacted_path = vim.fn.fnamemodify(tag.path, ":~:.")
                                local redacted_path = vim.fn.fnamemodify(tag.path, ":t")
                                if tag.path == current_buf_path then
                                    return "[" .. redacted_path .. "]"  -- or use * or any other indicator you prefer
                                end
                                return redacted_path
                            end, tags), " | ")
                        end,
                    }
                }
            },

But there are small issues here and there (I didn't document them, though).

Additional context

No response

@samueloph samueloph added the enhancement New feature or request label Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant