utilyre / barbecue.nvim

Visual Studio Code inspired breadcrumbs plugin for the Neovim editor
MIT License
776 stars 31 forks source link
document-symbols language-server-protocol lsp lua neovim neovim-plugin nvim nvim-plugin plugin winbar
# barbecue.nvim This is a VS Code like winbar that uses [nvim-navic][nvim-navic] in order to get LSP context from your language server.

https://user-images.githubusercontent.com/37078297/215765075-bc89050e-ad74-481a-9344-06ca997bf290.mp4

โœจ Features

๐Ÿ“ฌ Dependencies

๐Ÿ“ฆ Installation

NOTE: Make sure barbecue loads after your colorscheme.

๐Ÿš€ Usage

Barbecue will work right after installation, but there are several things you should be aware of.

Command

Run :Barbecue and you'll be prompted to select a subcommand, choose one and press <enter> to execute.

You can also run :Barbecue [sub] where [sub] is one of the subcommands you've seen in the select menu of raw :Barbecue.

API

๐Ÿด Recipes

๐Ÿš  Configuration

Click to see default config ```lua { ---Whether to attach navic to language servers automatically. --- ---@type boolean attach_navic = true, ---Whether to create winbar updater autocmd. --- ---@type boolean create_autocmd = true, ---Buftypes to enable winbar in. --- ---@type string[] include_buftypes = { "" }, ---Filetypes not to enable winbar in. --- ---@type string[] exclude_filetypes = { "netrw", "toggleterm" }, modifiers = { ---Filename modifiers applied to dirname. --- ---See: `:help filename-modifiers` --- ---@type string dirname = ":~:.", ---Filename modifiers applied to basename. --- ---See: `:help filename-modifiers` --- ---@type string basename = "", }, ---Whether to display path to file. --- ---@type boolean show_dirname = true, ---Whether to display file name. --- ---@type boolean show_basename = true, ---Whether to replace file icon with the modified symbol when buffer is ---modified. --- ---@type boolean show_modified = false, ---Get modified status of file. --- ---NOTE: This can be used to get file modified status from SCM (e.g. git) --- ---@type fun(bufnr: number): boolean modified = function(bufnr) return vim.bo[bufnr].modified end, ---Whether to show/use navic in the winbar. --- ---@type boolean show_navic = true, ---Get leading custom section contents. --- ---NOTE: This function shouldn't do any expensive actions as it is run on each ---render. --- ---@type fun(bufnr: number, winnr: number): barbecue.Config.custom_section lead_custom_section = function() return " " end, ---@alias barbecue.Config.custom_section ---|string # Literal string. ---|{ [1]: string, [2]: string? }[] # List-like table of `[text, highlight?]` tuples in which `highlight` is optional. --- ---Get custom section contents. --- ---NOTE: This function shouldn't do any expensive actions as it is run on each ---render. --- ---@type fun(bufnr: number, winnr: number): barbecue.Config.custom_section custom_section = function() return " " end, ---@alias barbecue.Config.theme ---|'"auto"' # Use your current colorscheme's theme or generate a theme based on it. ---|string # Theme located under `barbecue.theme` module. ---|barbecue.Theme # Same as '"auto"' but override it with the given table. --- ---Theme to be used for generating highlight groups dynamically. --- ---@type barbecue.Config.theme theme = "auto", ---Whether context text should follow its icon's color. --- ---@type boolean context_follow_icon_color = false, symbols = { ---Modification indicator. --- ---@type string modified = "โ—", ---Truncation indicator. --- ---@type string ellipsis = "โ€ฆ", ---Entry separator. --- ---@type string separator = "๎ชถ", }, ---@alias barbecue.Config.kinds ---|false # Disable kind icons. ---|table # Type to icon mapping. --- ---Icons for different context entry kinds. --- ---@type barbecue.Config.kinds kinds = { 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 = "๎ช’", }, } ```

๐Ÿ‘ฅ Contribution

See CONTRIBUTING.md.