feature: Provide example on how to show tags as tabs
- Dominant language
- Lua
- Stars
- 716
- Forks
- 33
- PR merge metrics
- No merged PRs in 30d
Description
### Did you check the docs?
- [X] 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_
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the README's lualine-component examples and compare them with the configuration shown in the issue. Document a top-bar example that lists tag relative paths and indicates the tag for the current buffer; completion means the example is clear and addresses the requested tab-like display.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua, neovim
- Domain
- documentation, tooling
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100