A popup window that provides breadcrumbs-like navigation in keyboard-centric manner. Inspired by hasansujon786/nvim-navbuddy.
With echasnovski/mini.deps:
MiniDeps.add("metafates/muffin.nvim")
Muffin.setup()
With folke/lazy.nvim:
{
"metafates/muffin.nvim",
opts = {}
}
Installing echasnovski/mini.icons is suggested to show icons and enable highlighting.
Muffin provides the following functions:
--- Opens a popup with document symbols.
--- No-op if already open.
function Muffin.open() ... end
--- Closes the current popup.
--- No-op if already closed.
---@return boolean closed Indicates if popup was closed.
function Muffin.close() ... end
--- Opens a popup if it was not opened, closes otherwise.
function Muffin.toggle() ... end
You may want to set a bind for toggling this popup:
vim.keymap.set("n", "T", function()
Muffin.toggle()
end, { desc = "Toggle Muffin popup" })
When popup is opened, you can use the following keys for certain actions:
Key | Action |
---|---|
c | Toggle comment on selected symbol |
f | Toggle fold on selected symbol |
q | Close popup |
h | Go back |
gh | Go back to root symbol |
l | Go forward |
gl | Go forward to the innermost symbol |
return or o | Close popup and leave cursor at selected symbol |
You can't rebind these keys yet.
- More actions. For example copying and reordering.
- Allow rebinding built-in keys.