π¦ Installation
use("loctvl842/breadcrumb.nvim", requires = {"nvim-tree/nvim-web-devicons"})
βοΈ Configuration
require("breadcrumb").setup({
disabled_filetype = {
"",
"help",
},
icons = {
File = "ο ",
Module = "ξ€ ",
Namespace = "ο ",
Package = "ξ€ ",
Class = "ο ",
Method = "ο¦ ",
Property = "ξ ",
Field = "ξ ",
Constructor = "ο₯ ",
Enum = "ο©",
Interface = "ο©",
Function = "ο ",
Variable = "ο¦ ",
Constant = "ο£Ύ ",
String = "ο« ",
Number = "ο’ ",
Boolean = "β© ",
Array = "ο© ",
Object = "ο¨ ",
Key = "ο ",
Null = "ο³ ",
EnumMember = "ο
",
Struct = "ο ",
Event = "ο§ ",
Operator = "ο ",
TypeParameter = "ο ",
},
separator = ">",
depth_limit = 0,
depth_limit_indicator = "..",
color_icons = true,
highlight_group = {
component = "BreadcrumbText",
separator = "BreadcrumbSeparator",
},
})
To have breadcrumb, it must be attached to lsp server.
Example:
local breadcrumb = require("breadcrumb")
local on_attach = function(client, bufnr)
...
if client.server_capabilities.documentSymbolProvider then
breadcrumb.attach(client, bufnr)
end
...
end
π Usage
- We can turn on
breadcrumb
by put this in the config file:
require("breadcrumb").init()
- Using method
get_breadcrumb()
combine with status line plugin for examplelualine
local breadcrumb = function()
local breadcrumb_status_ok, breadcrumb = pcall(require, "breadcrumb")
if not breadcrumb_status_ok then
return
end
return breadcrumb.get_breadcrumb()
end
local config = {
winbar = {
lualine_a = {},
lualine_b = {},
lualine_c = { breadcrumb },
lualine_x = {},
lualine_y = {},
lualine_z = {},
},
inactive_winbar = {
lualine_a = {},
lualine_b = {},
lualine_c = { breadcrumb },
lualine_x = {},
lualine_y = {},
lualine_z = {},
},
}
lualine.setup(config)
Command
BreadcrumbEnable
command to enablebreadcrumb
BreadcrumbDisable
command to disablebreadcrumb
TODO
- add default highlight for icons