Giter VIP home page Giter VIP logo

barbecue.nvim's Introduction

barbecue.nvim

This is a VS Code like winbar that uses nvim-navic in order to get LSP context from your language server.

demo.mp4

โœจ Features

  • ๐Ÿ–ฑ๏ธ Jump to any context by just clicking on it.

  • ๐ŸŒฒ Have a deeply nested file-tree/context? It's gonna get rid of the less useful parts smartly.

  • ๐Ÿ“‚ Easily tell where your file is located at by looking at your winbar.

  • ๐Ÿ“œ Put whatever your heart desires in the custom section.

๐Ÿ“ฌ Dependencies

๐Ÿ“ฆ Installation

NOTE: Make sure barbecue loads after your colorscheme.

  • lazy.nvim

    {
      "utilyre/barbecue.nvim",
      name = "barbecue",
      version = "*",
      dependencies = {
        "SmiteshP/nvim-navic",
        "nvim-tree/nvim-web-devicons", -- optional dependency
      },
      opts = {
        -- configurations go here
      },
    }
  • packer.nvim

    use({
      "utilyre/barbecue.nvim",
      tag = "*",
      requires = {
        "SmiteshP/nvim-navic",
        "nvim-tree/nvim-web-devicons", -- optional dependency
      },
      after = "nvim-web-devicons", -- keep this if you're using NvChad
      config = function()
        require("barbecue").setup()
      end,
    })

๐Ÿš€ 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

  • Toggle barbecue [source]

    -- hide barbecue globally
    require("barbecue.ui").toggle(false)
    
    -- show barbecue globally
    require("barbecue.ui").toggle(true)
    
    -- toggle barbecue globally
    require("barbecue.ui").toggle()
  • Update barbecue (e.g. in an autocmd) [source]

    -- update the current window's winbar
    require("barbecue.ui").update()
    
    -- update the given window's winbar
    require("barbecue.ui").update(winnr)
  • Navigate to entry [source]

    -- navigate to the second entry
    require("barbecue.ui").navigate(2)
    
    -- navigate to the last entry
    require("barbecue.ui").navigate(-1)
    
    -- just like before but on the given window
    require("barbecue.ui").navigate(index, winnr)

๐Ÿด Recipes

  • Gain better performance when moving the cursor around

    -- triggers CursorHold event faster
    vim.opt.updatetime = 200
    
    require("barbecue").setup({
      create_autocmd = false, -- prevent barbecue from updating itself automatically
    })
    
    vim.api.nvim_create_autocmd({
      "WinScrolled", -- or WinResized on NVIM-v0.9 and higher
      "BufWinEnter",
      "CursorHold",
      "InsertLeave",
    
      -- include this if you have set `show_modified` to `true`
      "BufModifiedSet",
    }, {
      group = vim.api.nvim_create_augroup("barbecue.updater", {}),
      callback = function()
        require("barbecue.ui").update()
      end,
    })
  • Customize theme

    You can pass a theme table to the setup function and override the default theme. This theme table links each highlight to its value (value is the same type as val parameter in :help nvim_set_hl).

    require("barbecue").setup({
      theme = {
        -- this highlight is used to override other highlights
        -- you can take advantage of its `bg` and set a background throughout your winbar
        -- (e.g. basename will look like this: { fg = "#c0caf5", bold = true })
        normal = { fg = "#c0caf5" },
    
        -- these highlights correspond to symbols table from config
        ellipsis = { fg = "#737aa2" },
        separator = { fg = "#737aa2" },
        modified = { fg = "#737aa2" },
    
        -- these highlights represent the _text_ of three main parts of barbecue
        dirname = { fg = "#737aa2" },
        basename = { bold = true },
        context = {},
    
        -- these highlights are used for context/navic icons
        context_file = { fg = "#ac8fe4" },
        context_module = { fg = "#ac8fe4" },
        context_namespace = { fg = "#ac8fe4" },
        context_package = { fg = "#ac8fe4" },
        context_class = { fg = "#ac8fe4" },
        context_method = { fg = "#ac8fe4" },
        context_property = { fg = "#ac8fe4" },
        context_field = { fg = "#ac8fe4" },
        context_constructor = { fg = "#ac8fe4" },
        context_enum = { fg = "#ac8fe4" },
        context_interface = { fg = "#ac8fe4" },
        context_function = { fg = "#ac8fe4" },
        context_variable = { fg = "#ac8fe4" },
        context_constant = { fg = "#ac8fe4" },
        context_string = { fg = "#ac8fe4" },
        context_number = { fg = "#ac8fe4" },
        context_boolean = { fg = "#ac8fe4" },
        context_array = { fg = "#ac8fe4" },
        context_object = { fg = "#ac8fe4" },
        context_key = { fg = "#ac8fe4" },
        context_null = { fg = "#ac8fe4" },
        context_enum_member = { fg = "#ac8fe4" },
        context_struct = { fg = "#ac8fe4" },
        context_event = { fg = "#ac8fe4" },
        context_operator = { fg = "#ac8fe4" },
        context_type_parameter = { fg = "#ac8fe4" },
      },
    })
  • Get nvim-navic working with multiple tabs (#35)

    require("barbecue").setup({
      attach_navic = false, -- prevent barbecue from automatically attaching nvim-navic
    })
    
    require("lspconfig")[server].setup({
      -- ...
    
      on_attach = function(client, bufnr)
        -- ...
    
        if client.server_capabilities["documentSymbolProvider"] then
          require("nvim-navic").attach(client, bufnr)
        end
    
        -- ...
      end,
    
      -- ...
    })

๐Ÿš  Configuration

Click to see default config
{
  ---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<string, string> # 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.

barbecue.nvim's People

Contributors

artandreev avatar dhruvasagar avatar ditsuke avatar f1rstlady avatar irubataru avatar ismailshak avatar krmbzds avatar linrongbin16 avatar mikewadsten avatar nickp-real avatar nycodeghg avatar sravioli avatar utilyre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

barbecue.nvim's Issues

Add ability to disable nvim-navic in UI

I'd like to use barbecue without nvim-navic.
I'd like nvim-navic to be shown in my statusbar lualine.
Currently, if I add a lualine navic component, I get them shown up in both barbecue and lualine.

Appreciate it.

[BUG]: Conflicts with winbars from other plugins, even when their filetype is added to exclude_filetypes

Requirements

  • I have scammed other issues to see if this bug has already been reported.
  • This plugin and its dependencies are up to date with the latest commit.
  • I'm willing to fix this through a PR.

Expected Behavior

This plugin shouldn't affect other plugins' winbars when those plugins' filetypes are added to exclude_filetypes; Neotree's source_selector should appear all the time when the Neotree is open.

Actual Behavior

When using this plugin and Neotree with its source_selector at the same time, the source_selector won't appear when:

* Neotree is focused
* Something else is focused, but focus has not changed from one buffer to another at least once.

This break is caused by barbecue (uninstalling barbecue returns source_selector behavior to normal)

Neovim Version

NVIM v0.9.0-dev-810+gb8288df99

Minimal Configuration

local install_path = vim.fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
local packer_bootstrap = nil
---@diagnostic disable-next-line: param-type-mismatch
if vim.fn.empty(vim.fn.glob(install_path, nil, nil, nil)) > 0 then
    packer_bootstrap = vim.fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim',
        install_path })
end
 
require('packer').startup(function(use)
    use "wbthomason/packer.nvim"
 
    if packer_bootstrap ~= nil then
        require('packer').sync()
    end
end)
 
local packer = require("packer)
 
packer.use {
    "SmiteshP/nvim-navic",
    requires = "neovim/nvim-lspconfig",
}
packer.use {
    "utilyre/barbecue.nvim",
    requires = {
        "neovim/nvim-lspconfig",
        "SmiteshP/nvim-navic",
    },
    config = function()
        require("barbecue").setup {
            attach_navic = false,
            show_modified = true,
            symbols = {
                separator = "๎‚ธ",
            },
            create_autocmd = false,
            theme = {
                normal = { fg = "#9daaaa", bg = "#24292f" }
            },
            include_buftypes = {
                ""
            },
            exclude_filetypes = {
                "gitcommit",
                "toggleterm",
                "aerial",
                "neo-tree",
                "terminal",
            },
        }
 
        vim.api.nvim_create_autocmd(
            {
                "WinScrolled",
                "BufWinEnter",
                "CursorHold",
                "CursorMoved",
                "CursorMovedI",
                "InsertLeave",
                "BufWritePost",
                "TextChanged",
                "TextChangedI",
            },
            {
                group = vim.api.nvim_create_augroup("barbecue#create_autocmd", {}),
                callback = function()
                    require("barbecue.ui").update()
                end
            })
    end,
}
packer.use {
    "nvim-neo-tree/neo-tree.nvim",
    branch = "v2.x",
    requires = {
        "nvim-lua/plenary.nvim",
        "nvim-tree/nvim-web-devicons",
        "MunifTanjim/nui.nvim",
        {
            -- only needed if you want to use the commands with "_with_window_picker" suffix
            's1n7ax/nvim-window-picker',
            tag = "v1.*",
            config = function()
                require 'window-picker'.setup({
                    autoselect_one = false,
                    include_current = false,
                    filter_rules = {
                        -- filter using buffer options
                        bo = {
                            -- if the file type is one of following, the window will be ignored
                            filetype = {
                                "neo-tree",
                                "neo-tree-popup",
                                "notify",
                                "aerial",
                                "packer"
                            },
                            -- if the buffer type is one of following, the window will be ignored
                            buftype = {
                                "terminal",
                                "quickfix"
                            },
                        },
                    },
                    other_win_hl_color = "#61afef",
                })
            end,
        }
    },
    config = function()
        vim.cmd("let g:neo_tree_remove_legacy_commands = 1")
 
        require("neo-tree").setup {
            sources = {
                "filesystem",
                "git_status",
            },
            source_selector = {
                winbar = true,
                statusline = false,
                show_scrolled_off_parent_node = false,
                content_layout = "start",
                tab_labels = {
                    filesystem = " ๏’ File",
                    buffers = "๏œ™ Buffer",
                    git_status = "๏žก Git",
                    diagnostics = "๏ฆ Lints"
                }
            },
            hide_root_node = true,
            expand_all_nodes = false,
            close_if_last_window = true,
            popup_border_style = "rounded",
            enable_git_status = true,
            enable_diagnostics = true,
            sort_case_insensitive = true,
            default_component_configs = {
                indent = {
                    indent_size = 2,
                    padding = 1,
                    with_markers = true,
                    indent_marker = "โ”‚",
                    last_indent_marker = "โ””",
                    highlight = "NeoTreeIndentMarker",
                    with_expanders = true,
                    expander_collapsed = "๏‘ ",
                    expander_expanded = "๏‘ผ",
                    expander_highlight = "NeoTreeExpander",
                },
                icon = {
                    folder_closed = "๎—ฟ",
                    folder_open = "๎—พ",
                    folder_empty = "๏”",
                    default = "๎˜’",
                },
                name = {
                    trailing_slash = false,
                    use_git_status_colors = true,
                },
                git_status = {
                    symbols = {
                        added = "๏†–",
                        deleted = "๏‘˜",
                        modified = "๏‘„",
                        renamed = "โžœ",
                        untracked = "โ˜…",
                        ignored = "โ—Œ",
                        unstaged = "โœ—",
                        staged = "โœ“",
                        conflict = "๎œง",
                    },
                },
            },
            window = {
                position = "left",
                width = 30,
                mappings = {
                    ["<2-LeftMouse>"] = "open",
                    ["<cr>"] = "open",
                    ["e"] = "open",
                    ["s"] = "open_vsplit",
                    ["R"] = "refresh",
                    ["a"] = "add",
                    ["d"] = "delete",
                    ["r"] = "rename",
                    ["y"] = "copy_to_clipboard",
                    ["x"] = "cut_to_clipboard",
                    ["p"] = "paste_from_clipboard",
                    ["q"] = "close_window",
                    ["<C-t>"] = "close_window",
                    ["<"] = "prev_source",
                    [">"] = "next_source",
                },
            },
            filesystem = {
                filtered_items = {
                    visible = false,
                    hide_dotfiles = false,
                    hide_gitignored = false,
                    hide_by_name = {
                        ".DS_Store",
                        "thumbs.db",
                        "node_modules",
                        "__pycache__",
                    },
                },
                follow_current_file = true,
                hijack_netrw_behavior = "open_current",
                use_libuv_file_watcher = true,
                window = {
                    position = "left",
                    width = 30,
                    mappings = {
                        ["H"] = "toggle_hidden",
                        ["/"] = "filter_on_submit",
                        ["<c-x>"] = "clear_filter",
                    },
                },
            },
            buffers = {
                show_unloaded = true,
                window = {
                    position = "left",
                    width = 30,
                    mappings = {
                        ["bd"] = "buffer_delete",
                    },
                },
            },
            git_status = {
                follow_current_file = true,
                window = {
                    position = "left",
                    width = 30,
                    mappings = {
                        ["A"] = "git_add_all",
                        ["u"] = "git_unstage_file",
                        ["a"] = "git_add_file",
                        ["r"] = "git_revert_file",
                        ["c"] = "git_commit",
                        ["p"] = "git_push",
                        ["cp"] = "git_commit_and_push",
                    },
                },
            },
            event_handlers = {
                {
                    event = "vim_buffer_enter",
                    handler = function(_)
                        if vim.bo.filetype == "neo-tree" then
                            vim.wo.signcolumn = "auto"
                        end
                    end,
                },
            },
        }
    end
}
packer.use "folke/tokyonight.nvim"

-- add anything else here
vim.opt.termguicolors = true
-- do not remove the colorscheme!
vim.cmd([[colorscheme tokyonight]])

Reproduction

1. open neovim and update plugins:
    a. `nvim`
    b. `:PackerSync`
2. open neovim: `nvim some_file`
3. open Neotree `:Neotree`
4. Neotree's source_selector winbar isn't visible/behaves as said above

[BUG]: Unsupported layout_config key for the center strategy: preview_height

Requirements

  • I have scammed other issues to see if this bug has already been reported.
  • This plugin and its dependencies are up to date with the latest commit.
  • I'm willing to fix this through a PR.

Expected Behavior

I execute :Barbecue command with no arguments and it displays a list of command to execute.

Actual Behavior

I get the expected behaviour but I also get a lot of errors (see screenshot).

The error appears to be related to this section of Telescope?
https://github.com/nvim-telescope/telescope.nvim/blob/master/lua/telescope/pickers/layout_strategies.lua#L168

Screenshot 2023-01-27 at 16 45 34


Unsupported layout_config key for the center strategy: preview_height
{
  bottom_pane = {
    height = <function 1>,
    preview_cutoff = 1,
    prompt_position = "top"
  },
  center = {
    height = <function 1>,
    preview_cutoff = 1,
    prompt_position = "top",
    width = <function 2>
  },
  cursor = {
    height = <function 1>,
    preview_cutoff = 1,
    width = <function 2>
  },
  height = <function 1>,
  horizontal = {
    height = <function 1>,
    preview_cutoff = 1,
    prompt_position = "bottom",
    width = <function 2>
  },
  preview_cutoff = 1,
  preview_height = 0.7,
  vertical = {
    height = <function 1>,
    preview_cutoff = 1,
    prompt_position = "bottom",
    width = <function 2>
  },
  width = <function 2>
}

Neovim Version

NVIM v0.8.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by [email protected]

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.8.2/share/nvim"

Run :checkhealth for more info

Minimal Configuration

local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "--single-branch",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  -- do not remove the colorscheme!
  "folke/tokyonight.nvim",

  {
    "utilyre/barbecue.nvim",
    dependencies = {
      "neovim/nvim-lspconfig",
      "SmiteshP/nvim-navic",
      "nvim-tree/nvim-web-devicons",
    },
    config = function() 
      require("barbecue").setup()
    end,
  },
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

-- add anything else here
vim.opt.termguicolors = true
-- do not remove the colorscheme!
vim.cmd([[colorscheme tokyonight]])

Reproduction

Sorry I use packer not lazy.nvim and so I was strugging to actually get the folke/noice plugin installed and running without errors and in the end failed to ๐Ÿ˜ฌ so unfortunately I can't say for sure what is causing the error.

I actually don't really need to run the Ex command this plugin exposes and so the fact it errors doesn't actually bother me, but I wanted to report it anyway just in case it was affecting other people, but I didn't really want to waste of ton of time. So with that in mind I totally understand if you feel you want to close this issue as the report is incomplete ๐Ÿ‘๐Ÿป

[BUG]: Dev Icons don't show up

Requirements

  • I have skimmed other issues to see if this bug has already been reported.
  • I'm fully certain that this is not a breaking change, see the latest release.
  • This plugin and its dependencies are up to date with the latest commit.
  • I'm willing to fix this through a PR.

Expected Behavior

Winbar to show icons

Actual Behavior

Winbar only shows rectangles in place of icons

image

Neovim Version

0.8.3

Minimal Configuration

return {
  {
    "utilyre/barbecue.nvim",
    dependencies = {
      "SmiteshP/nvim-navic",
      "nvim-tree/nvim-web-devicons", -- optional dependency
    },
    config = function()
      local ok, barbecue = pcall(require, "barbecue")

      if not ok then
        vim.notify("barbecue.nvim not installed", vim.log.levels.ERROR)
        return
      end

      barbecue.setup({})
    end,
  },
}

Reproduction

install

[Enhancement] Specific highlight groups that can be overwritten and supported by colorschemes

Moving #41 to an issue and keen to get other views on this. Acknowledge there has been discussion on this in #30.

Is your feature request related to a problem? Please describe.
It's currently difficult to get barbecue to match my colorscheme unless that colorscheme has support for it out of the box using barbecue.Theme.

Describe the solution you'd like
Barbecue used to employ highlights such as BarbecueModified and BarbecueBasename. This allowed myself, as a colorscheme maintainer, to overwrite them to ensure that they matched the overall aesthetic of my colorscheme.

Also, as a user of barbecue, it meant that I could easily overwrite the highlights if I wanted something different to the colorscheme's opinion.

Additional context

  • Most colorscheme's have support for plugins out of the box (see the nvim-navic example in my colorscheme)
  • For my colorscheme's case, it's simply a matter of matching the plugin's highlight groups to the color palette
  • The one exception I make is with lualine which is somethiing I accept as it is one of the most popular plugins in the Neovim community
  • However, conforming to a plugin's theming API is far more difficult:
    • It requires me to understand the API fully
    • It requires testing to ensure I've understood it accurately
    • It requires watching to in case the API changes and breaks my current support
  • Finally, most colorschemes allow users to overwrite highlight groups to achieve a great deal of customisation. This is much easier when a plugin exposes highlight groups.

Summary
Firstly, I write this issue because I thoroughly value barbecue as a plugin and I've missed using it since the barbecue.Theme feature was implemented. Secondly, whilst I think that the theming was implemented in good faith, it makes support for the plugin that much more difficult as colorscheme owners need to invest time to understand your API. Finally, I believe it goes against the majority of what other plugin scheme authors do when they expose highlight groups for colorscheme owners to work with.

[BUG]: Navigate to entry api has disappeared

Requirements

  • I have scammed other issues to see if this bug has already been reported.
  • I'm fully certain that this is not a breaking change, see the latest release.
  • This plugin and its dependencies are up to date with the latest commit.
  • I'm willing to fix this through a PR.

Expected Behavior

Being able to call require("barbecue.ui").navigate(2) like it's described in the docs

- Navigate to entry [source]

Actual Behavior

calling the function fails because it has been removed in d8dad18

Neovim Version

NVIM v0.9.0-dev
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fno-common -fdiagnostics-color=auto -fstack-protector-strong -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DMIN_LOG_LEVEL=3 -DNVIM_UNIBI_HAS_VAR_FROM -I/usr/include/luajit-2.1 -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/home/grota/.cache/paru/clone/nvim-nightly/src/build/src/nvim/auto -I/home/grota/.cache/paru/clone/nvim-nightly/src/build/include -I/home/grota/.cache/paru/clone/nvim-nightly/src/build/cmake.config -I/home/grota/.cache/paru/clone/nvim-nightly/src/neovim-nightly/src -I/usr/include -I/usr/include -I/usr/include
Compiled by grota

Features: +acl +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Minimal Configuration

local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "--single-branch",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  -- do not remove the colorscheme!
  "folke/tokyonight.nvim",

  {
    "utilyre/barbecue.nvim",
    dependencies = {
      "neovim/nvim-lspconfig",
      "SmiteshP/nvim-navic",
      "nvim-tree/nvim-web-devicons",
    },
    config = function() 
      require("barbecue").setup()
    end,
  },
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

-- add anything else here
vim.opt.termguicolors = true
-- do not remove the colorscheme!
vim.cmd([[colorscheme tokyonight]])

Reproduction

  1. :lua require("barbecue.ui").navigate(1)

Allow disabling of nvim-navic

I like to use nvim-navic for stuff othan the my winbar, and I do not want it to be in it.
E.g. I might want to show the navic "gps" on a keymap.
If I have it installed, barbecue picks it up and I can't disable that.

[FEAT]: Allow customizable override for detecting `modified`

Requirements

  • This feature isn't just a vague idea and has a good practical solution.
  • I'm completely sure that this feature fits into this plugin.
  • I'm willing to implement this through a PR.

Problem

While highlighting modified based on whether the buffer has been modified is useful, I find it more useful to know if the buffer has been modified in source control (git). There are likely other ways like git-gutter that people find useful, but I don't really like that and find them noisy, I just want to see in a glance if the file has been modified and I can review the changes separately.

I am aware of the custom_section property and had been using it but I like this instead since it's more noticeable

Solution Suggestion

The following works for me, I can create a PR if you think it's useful :

diff --git a/lua/barbecue/config/template.lua b/lua/barbecue/config/template.lua
index 76d23c5..b04d2d8 100644
--- a/lua/barbecue/config/template.lua
+++ b/lua/barbecue/config/template.lua
@@ -38,6 +38,8 @@ local M = {
   ---@type boolean
   show_modified = false,
 
+  modified = function(bufnr) return vim.bo[bufnr].modified end,
+
   ---whether to show/use navic in the winbar
   ---@type boolean
   show_navic = true,
diff --git a/lua/barbecue/ui/components.lua b/lua/barbecue/ui/components.lua
index 70b9364..601fad7 100644
--- a/lua/barbecue/ui/components.lua
+++ b/lua/barbecue/ui/components.lua
@@ -72,7 +72,7 @@ function M.basename(winnr, bufnr)
     vim.fn.fnamemodify(filename, config.user.modifiers.basename .. ":t")
 
   local icon
-  if vim.bo[bufnr].modified and config.user.show_modified then
+  if config.user.modified(bufnr) and config.user.show_modified then
     icon = {
       config.user.symbols.modified,
       highlight = theme.highlights.modified,

This allows me to override this with something like this in my configs :

require('barbecue').setup({
  modified = function()
    return vim.fn["StatusLineGitFlag"]() ~= ""
  end
})

Workaround

No response

Using with lualine.nvim

I found it could be used as a component of lualine.nvim with a little effort of coding to expose a api by which we can get the winbar data.

Entries are always truncated if custom section includes whitespace separator (%=)

Hello! Since 59f9656, barbecue entries are always truncated because
I've configured custom_section to be prefixed with %= so that it is right-aligned. This results
in custom_section_length to be very large because it includes a bunch of leading spaces (the
padding necessary to right-align it), effectively triggering truncation every time.

Not sure what the best way to work around this would be. After looking into the code my first idea
was that it might be best to construct the complete winbar and nvim_eval_statusline() it to see if
truncation needs to be applied. The winbar already rearranges items in case it overflows, so another
option would be to simply not do any custom truncation at all and delegate that to Neovim.

Thanks!

Missing default value handling for .setup()

It seems like you don't default to an empty value if you call setup with no arguments. Maybe you can add a simple

if config == nil then
  config = {}
end

at the beginning of the setup function.

By the way, which font is the separator from? I use a nerdfont font, but it is still a box for me.

Conflicts with anuvyklack/windows.nvim after restoring a multi-splits session.

Description

As title. I got the error message:

Error  01:51:19 msg_show.lua_error Error executing vim.schedule lua callback: ...l/share/nvim/lazy/windows.nvim/lua/windows/lib/frame.lua:98: attempt to index local 'curwinLeaf' (a nil value)
stack traceback:
	...l/share/nvim/lazy/windows.nvim/lua/windows/lib/frame.lua:98: in function 'autowidth'
	.../nvim/lazy/windows.nvim/lua/windows/calculate-layout.lua:27: in function 'autowidth'
	...l/share/nvim/lazy/windows.nvim/lua/windows/autowidth.lua:40: in function ''
	vim/_editor.lua: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>

If I disable barbecue.nvim then the error is gone. (I reported this in anuvyklack/windows.nvim too, but it looks like the author has abandoned the issues section since there are some issues created in Sep. without any reply.)

Reproduce

To reproduce, you can use my config (assuming you use packer.nvim):

use {
  'anuvyklack/windows.nvim',
  requires = {
    'anuvyklack/middleclass',
    'anuvyklack/animation.nvim'
  },
  config = function()
    vim.o.winwidth = 10
    vim.o.winminwidth = 10
    vim.o.equalalways = false
    require('windows').setup {
      autowidth = {
        enable = true, -- I need to set it `false` to get rid of the error.
      },
      ignore = {
        filetype = { 'neo-tree', 'lazy', 'noice' },
      }
    }
  end
}
demo_conflict_windows_nvim.mov

Custom Section as default

Hi!

I want to put my winbar right aligned. is there a way that I can get the winbar created but put it in the custom section?

Switching themes will cause an error

As the title says, after neovim starts, if you change the current theme, an error will be reported, and the color of barbecue will disappear.

before:
image

after changing the theme (even changing to the same theme):
image

Error message:

Error executing vim.schedule lua callback: ...s/code/nvim/barbecue.nvim/lua/barbecue/ui/components.lua:26: invalid key: 
stack traceback:
	[C]: in function 'nvim_set_hl'
	...s/code/nvim/barbecue.nvim/lua/barbecue/ui/components.lua:26: in function 'get_file_icon'
	...s/code/nvim/barbecue.nvim/lua/barbecue/ui/components.lua:110: in function 'get_basename'
	...ed/Documents/code/nvim/barbecue.nvim/lua/barbecue/ui.lua:62: in function 'create_entries'
	...ed/Documents/code/nvim/barbecue.nvim/lua/barbecue/ui.lua:146: in function <...ed/Documents/code/nvim/barbecue.nvim/lua/barbecue/ui.lua:135>

Note the error only generates when opening a new type of file.

[BUG]: E539: Illegal character <[>

Requirements

  • I have skimmed other issues to see if this bug has already been reported.
  • I'm fully certain that this is not a breaking change, see the latest release.
  • This plugin and its dependencies are up to date with the latest commit.
  • I'm willing to fix this through a PR.

Expected Behavior

No error

Actual Behavior

Error in :messages:

Error executing vim.schedule lua callback: ...local/share/nvim/lazy/barbecue/lua/barbecue/ui/entry.lua:47: E539: Illegal character <[>
stack traceback:
[C]: in function 'nvim_eval_statusline'
...local/share/nvim/lazy/barbecue/lua/barbecue/ui/entry.lua:47: in function 'len'
...tyom/.local/share/nvim/lazy/barbecue/lua/barbecue/ui.lua:117: in function 'create_entries'
...tyom/.local/share/nvim/lazy/barbecue/lua/barbecue/ui.lua:216: in function <...tyom/.local/share/nvim/lazy/barbecue/lua/barbecue/ui.lua:200>

Error executing vim.schedule lua callback: ...local/share/nvim/lazy/barbecue/lua/barbecue/ui/entry.lua:47: E539: Illegal character
stack traceback:
[C]: in function 'nvim_eval_statusline'
...local/share/nvim/lazy/barbecue/lua/barbecue/ui/entry.lua:47: in function 'len'
...tyom/.local/share/nvim/lazy/barbecue/lua/barbecue/ui.lua:117: in function 'create_entries'
...tyom/.local/share/nvim/lazy/barbecue/lua/barbecue/ui.lua:216: in function <...tyom/.local/share/nvim/lazy/barbecue/lua/barbecue/ui.lua:200>

Neovim Version

NVIM v0.9.0
Build type: Release
LuaJIT 2.1.0-beta3

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.9.0/share/nvim"

Run :checkhealth for more info

Minimal Configuration

local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
	vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
	vim.fn.system({
		"git",
		"clone",
		"--filter=blob:none",
		"--single-branch",
		"https://github.com/folke/lazy.nvim.git",
		lazypath,
	})
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
	-- do not remove the colorscheme!
	"folke/tokyonight.nvim",

	{
		"utilyre/barbecue.nvim",
		dependencies = {
			"neovim/nvim-lspconfig",
			"SmiteshP/nvim-navic",
			"nvim-tree/nvim-web-devicons",
		},
		config = function()
			require("barbecue").setup()
		end,
	},
	{
		"neovim/nvim-lspconfig",
		config = function()
			require("lspconfig").lua_ls.setup({})
		end,
	},
}
require("lazy").setup(plugins, {
	root = root .. "/plugins",
})

-- add anything else here
vim.opt.termguicolors = true
-- do not remove the colorscheme!
vim.cmd([[colorscheme tokyonight]])

Reproduction

  1. Open Neovim runtime folder (in my case /opt/homebrew/Cellar/neovim/0.9.0/share/nvim/runtime)
  2. nvim -u repro.lua lua/vim/filetype.lua
  3. Wait until LSP is loaded (semantic highlighting will be applied)
  4. Go to line 1801, you should be inside ['.*%.[Cc][Ff][Gg]'] block
  5. Get an error E539: Illegal character <[>
  6. Go to line 1904, you should be inside ['.*%.git/.*'] block
  7. Get an error E539: Illegal character <g>

Haven't tried with nvim-navic only.

[FEAT]: Allow the context texts to follow the colors of the context icons

Requirements

  • This feature isn't just a vague idea and has a good practical solution.
  • I'm completely sure that this feature fits into this plugin.
  • I'm willing to implement this through a PR.

Problem

Hi, I love the design of your plugin and want to say thank you first for your excellent work.

Once of my perferences is that I hope the context text could follow the colors of the context icons. Currently, the colors of all context texts are determined by the theme.context field, while each context icon can have a different color. I am wondering if you can add an option to allow the text following the context icon to share the color of the context icon.

For example, in the following screenshot, I hope the text test to have the same color as the context_namespace, i.e, orange color.
image

Solution Suggestion

Described above.

Workaround

No response

Additional highlight groups

  1. I would like to color the modified icon as yellow
  2. I would like to have the ability to set the background color of the whole winbar

Thanks for the awesome plugin!

[FEAT]: nvim_set_hl should set "default"

Requirements

  • This feature isn't just a vague idea and can have a good practical solution.
  • I'm completely sure that this feature fits into this plugin.
  • I'm willing to implement this through a PR.

Problem

Consider a scenario where I am manually setting the highlight groups for barbecue via a colorscheme plugin.

colorscheme plugin loads first -> sets hl groups for barbecue
barbecue loads second -> overrides the hl groups already set by the colorscheme plugin

Solution Suggestion

Using the default flag avoids this problem completely. This will allow me to keep my highlight groups in a unified location (in the colorscheme file) if I want to. I don't think there are any drawbacks.

Workaround

Configuring the load order of plugins. If barbecue loads first, the colorscheme plugin correctly overrides the hl groups as expected.

Just started to get this error in barbacue: ...\init.lua:13: attempt to index field 'symbols' (a nil value)

Hello.
Im not sure if this is because another plugin that barbacue depends on has been updated recently bu I have started to get this error:
packer.nvim: Error running config for barbecue.nvim: ...\packer\start\barbecue.nvim/lua\barbecue\config\init.lua:13: attempt to index field 'symbols' (a nil value)
I have to comment lines 13-15 in barbecue.nvim/lua\barbecue\config\init.lua to get the plugin working again without errors.
Any idea where this error can come from?
Thanks

[BUG]: Vim:E36: Not enough room

Requirements

  • I have scammed other issues to see if this bug has already been reported.
  • This plugin and its dependencies are up to date with the latest commit.
  • I'm willing to fix this through a PR.

Expected Behavior

There shouldn't be any error from barbecue, when calling the CodeActionMenu command.

Actual Behavior

Executing CodeActionMenu from nvim-code-action-menu causes an error from barbecue (the first time it works, but afterwards calling CodeActionMenu results in this error)

Screenshot from 2023-02-02 21-31-13

Neovim Version

NVIM v0.9.0-dev-781+gda671b21c

Minimal Configuration

local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "--single-branch",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  -- do not remove the colorscheme!
  "folke/tokyonight.nvim",

  {
      'weilbith/nvim-code-action-menu',
      cmd = 'CodeActionMenu',
      keys = { "<leader>ca", "<Cmd>CodeActionMenu<CR>" },
  },

  {
      "neovim/nvim-lspconfig",
      keys = {
	      { "dn", "<Cmd>lua vim.diagnostic.goto_next()<CR>" },
	      { "dp", "<Cmd>lua vim.diagnostic.goto_prev()<CR>" },
      },
      config = function()
	require('lspconfig')['rust_analyzer'].setup{}
      end,
  },

  { "williamboman/mason.nvim", opts = {} },

  {
    "utilyre/barbecue.nvim",
    dependencies = {
      "neovim/nvim-lspconfig",
      "SmiteshP/nvim-navic",
      "nvim-tree/nvim-web-devicons",
    },
    config = function()
      require("barbecue").setup()
    end,
  },
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

-- add anything else here
vim.opt.termguicolors = true
-- do not remove the colorscheme!
vim.cmd([[colorscheme tokyonight]])

Reproduction

Just use CodeActionMenu command when LSP gives you a code-action

[question] Focusing window issue (?)

Hi! Great plugin :)

Not sure if a bug, but when doing :vsplits and changing between windows with :wincmd (or mouse clicking) it resizes the bottom bar up to 50% of the screen, not sure if a bug or a configuration issue. Happens everytime require('barbecue.ui').toggle() or .update() is called. Any ideas what might be the cause? Looking through ui.lua didn't help me much to identify what is the root cause though.

Here's how it looks after switching from focused window:

image

(Disabling barbecue fixes the problem, which makes me think it is causing that behavior, may be a conflict with another plugin though)

Thanks!

[FEAT]: auto-hide winbar when empty

Requirements

  • This feature isn't just a vague idea and can have a good practical solution.
  • I'm completely sure that this feature fits into this plugin.
  • I'm willing to implement this through a PR.

Problem

sometimes when navigating, navic returns an empty string, and then theres an empty winbar covering up text

Solution Suggestion

when navic returns an empty string, the winbar should toggle its visibility

Workaround

No response

Different highlights for file path and code context.

Hi there, thanks for this awesome plugin! My wishful request: I would like to highlight the file path separately from the code context. I.e.,

path > to > foo.lua > this > is > a > method context.

In addition, it would be awesome if the "buffer modified" indicator could be configured to appear in the beginning of the path, as opposed to the end as currently implemented. i.e.,

+ path > to > foo.lua > this > is > a > method context

where + is the modification indicator.

Thanks!

Toggle visibility

Hi! I was playing around with getting a zen-mode plugin up and running for focused writing (Ataraxis-mode on true-zen, used to use Goyo.vim), and if I enable that then the only status bar I have left is barbecue. Is there a simple way to hide it? Ideally I want to be able to toggle it so I can hide it when I enter the mode, and enable it again when I leave.

[FEAT]: Clickable directory Entries

Requirements

  • This feature isn't just a vague idea and can have a good practical solution.
  • I'm completely sure that this feature fits into this plugin.
  • I'm willing to implement this through a PR.

Problem

It would be nice to be able to click on the directories and have a callback fire

an example use-case would be to open nerdtree or oil.nvim to that directory

Solution Suggestion

adding an additional onClick to the Entry class should be simple,
I'm not sure how you would want to implement it though

the current to = {} stuff could be made generic to to use the same click handlers with a default implementation

configuration could be done pretty simply with a table

function Entry:navigate()
  local handler = config.onclick[entry.type] or function (entry)
    vim.cmd.mark("'")

    vim.api.nvim_set_current_win(entry.to.win)
    vim.api.nvim_win_set_cursor(entry.to.win, entry.to.pos)
  end
  handler(self)
end

require('barbecue').setup({
  onclick = {
    dir = function (entry) 
      require('nerdtree').focus(entry.filepath)
    end,
  }
})

some additional parameters would be required on the Entry to make this useable, like the filepath one above

Workaround

No response

[FEAT]: setup theme

Requirements

  • This feature isn't just a vague idea and can have a good practical solution.
  • I'm completely sure that this feature fits into this plugin.
  • I'm willing to implement this through a PR.

Problem

setup theme overrides base46 (https://github.com/NvChad/base46)

Solution Suggestion

You can add feature. (theme=off) does not allow overriding.

Workaround

No response

Add highlight group for the remainder of the bar

I'm currently trying to set a uniform bg highlight color for all components in the entire winbar, but I can't find any way to do so. While I can manually set the bg color for each of the WinBar and Barbecue* highlight groups individually, there isn't any highlight group which handles the remainder of the winbar.

Looking inside the vim.schedule() callback at the bottom of lua/barbecue/ui.lua, I see that winbar has %#Normal#%= appended to it before the custom_section is run, which means I can't change it out for a different highlight group after the fact. It would be nice if %#Normal#%= was replaced with %#BarbecueRemainder#%= (feel free to bikeshed the name) where BarbecueRemainder is linked to Normal by default. This would allow users to redefine said highlight group to whatever they wish if they'd like to customize the bar's background color.

Many thanks for this awesome plugin. โค๏ธ

Including file name, but not parent directories

Sorry if this is already in the documentation and I'm just being blind, but is there a way to have it so the file name is included in the winbar, but not the path to the file? So if I'm in a different directory from the file I'm working on, it would be:

filename.extension > and > so > on

Rather than:

path > to > filename.extension > and > so > on

If it's not included yet, and you do wish to implement this, it could be in variable like include_path which defaults to true to keep the current default.

If there was some sort of truncation, how would you like it to be?

Files with long paths or JSON documents in which there is so much nesting can be really annoying in winbar. So what do you think is needed to be done for this problem?

I leave my ideas here but feel free to comment your own idea

  1. A function in the config that receives the width of the current window along side the current length of winbar (including custom_section) and returns a number that indicates how many "entries" will be truncated.
  2. Same as previous but have different functions for dirname, filename, and context.
  3. An automatic logic that truncates as much characters as needed (from less crucial parts) in order to prevent Neovim from truncating the winbar itself.

Since I'm really busy with my lessons these days, I'm gonna need some time and also help from you guys to solve this issue.

[FEAT]: Can we craete a jumplist before calling the navigate?

Requirements

  • This feature isn't just a vague idea and can have a good practical solution.
  • I'm completely sure that this feature fits into this plugin.
  • I'm willing to implement this through a PR.

Problem

I have this map

vim.keymap.set("n", "[[", ":lua require('barbecue.ui').navigate(-1)<CR>")

once the cursor moved, I want to get it back to the previous position with <C-o>

Solution Suggestion

we can add a jumplist before the navigate function

Workaround

-- lua/barbecue/ui.lua > M.navigate

-- ...
-- create a jump list
vim.cmd("normal! m'")

local clickable_entry = Entry.from(clickable_entries[index])
clickable_entry:navigate()

is there a way to make the separators have colours?

this is how it looks like now -
image

my question is - is there a way to add any colors to it? cant seem to find a way to do that i tried adding other icons, just white would also be fine like what colour of the ligature is.

for example like this (its from lunarvim) -
image

Btw love this plugin

Customizing colors

Hi !

Let me first thank you for saving me the trouble of setting this up myself !

I have a transparent background and somehow it doesn't get removed behind the filename, even with hl WinBar guibg=NONE.
Also, I'd like to be able to change the colors dynamically. Do you think I can do that easily ?

Thanks again

I can't require barbecue from files

For some reason the only way to setup barbecue that works for me is the one specified in the documentation:

use({
  "utilyre/barbecue.nvim",
  branch = "dev", -- omit this if you only want stable updates
  requires = {
    "neovim/nvim-lspconfig",
    "smiteshp/nvim-navic",
    "nvim-tree/nvim-web-devicons", -- optional dependency
  },
  after = "nvim-web-devicons", -- keep this if you're using NvChad
  config = function()
    require("barbecue").setup()
  end,
})

But no matter what file is, it can't be required from others.

plugins/barbecue-nvim.lua

require("barbecue").setup()

Is throwing this error:

Error detected while processing /Users/diego/.config/nvim/init.lua:
module 'barbecue' not found:
        no field package.preload['barbecue']
        ...

What I'm doing wrong?

I've done this with a lot of plugins, but this is the only one that's failing...

[BUG]: Winbar appears, flickers then disappears

Requirements

  • I have scammed other issues to see if this bug has already been reported.
  • I'm fully certain that this is not a breaking change, see the latest release.
  • This plugin and its dependencies are up to date with the latest commit.
  • I'm willing to fix this through a PR.

Expected Behavior

Winbar should stay on-screen as shown in the example gif

Actual Behavior

Appearing then disappearing:
https://user-images.githubusercontent.com/38540736/218783030-be32e4ee-4651-4d96-9e0f-e4fedd4f035a.mp4

Flickering (only seems to be visible when cursor is moving)
https://user-images.githubusercontent.com/38540736/218788089-c6652569-fd53-492e-9e4b-842defdd8084.mp4

Neovim Version

NVIM v0.9.0-dev-952+g20c9f4b35
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fno-common -fdiagnostics-color=always -fstack-protector-strong -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DMIN_LOG_LEVEL=3 -DNVIM_UNIBI_HAS_VAR_FROM -I/home/willothy/vendor/neovim/.deps/usr/include/luajit-2.1 -I/usr/include -I/home/willothy/vendor/neovim/.deps/usr/include -I/home/willothy/vendor/neovim/.deps/usr/include -I/home/willothy/vendor/neovim/.deps/usr/include -I/home/willothy/vendor/neovim/.deps/usr/include -I/home/willothy/vendor/neovim/build/src/nvim/auto -I/home/willothy/vendor/neovim/build/include -I/home/willothy/vendor/neovim/build/cmake.config -I/home/willothy/vendor/neovim/src -I/home/willothy/vendor/neovim/.deps/usr/include -I/home/willothy/vendor/neovim/.deps/usr/include -I/home/willothy/vendor/neovim/.deps/usr/include

(also tried on latest nvim 8.3 available on Zypper, same issue)

Minimal Configuration

local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
    vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

--   -- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
    vim.fn.system({
        "git",
        "clone",
        "--filter=blob:none",
        "--single-branch",
        "https://github.com/folke/lazy.nvim.git",
        lazypath,
    })
end
vim.opt.runtimepath:prepend(lazypath)

--                               -- install plugins
local plugins = {
    -- do not remove the colorscheme!
    "folke/tokyonight.nvim",

    {
        "utilyre/barbecue.nvim",
        dependencies = {
            "neovim/nvim-lspconfig",
            "SmiteshP/nvim-navic",
            "kyazdani42/nvim-web-devicons",
        },
        config = function()
            require("barbecue").setup()
        end,
    },
    {
        "nvim-lualine/lualine.nvim",
        dependencies = {
            "kyazdani42/nvim-web-devicons",
        },
        config = function()
            local circle_left = '๎‚ถ'
            local circle_right = '๎‚ด'
            require("lualine").setup({
                options = {
                    theme = "tokyonight",
                    always_divide_middle = true,
                    globalstatus = true,
                },
                sections = {
                    -- left side
                    lualine_a = { { 'mode' } },
                    lualine_b = { { 'branch' } },
                    lualine_c = { { 'filename' } },
                    -- right side
                    lualine_x = { { 'encoding' } },
                    lualine_y = { { 'filetype' } },
                    lualine_z = { { 'location' } },
                },
                -- Removing this fixes the issue
                winbar = {
                    -- left side
                    lualine_c = { {} },
                    lualine_a = { {} },
                    lualine_b = { {} },
                    -- right side
                    lualine_x = { {} },
                    lualine_y = { {} },
                    lualine_z = { {} },
                },
            })
        end,
    }
}
require("lazy").setup(plugins, {
    root = root .. "/plugins",
})

-- add anything else here
vim.opt.termguicolors = true
-- do not remove the colorscheme!
vim.cmd([[colorscheme tokyonight]])

Reproduction

  1. Start neovim
  2. Start editing nvim configs
  3. Barbecue flickers on and off or just disappears entirely

It seems that barbecus.nvim cannot work with multiple tabpages.

As title. I used the same default setup as README.md, and only those buffers shown in the first tabpage got updated. Buffers that were in the other tabpages just got frozen like: lua > file.lua. I also tried create_autocmd = false and created it myself, and got the same result.

`E5108: Error executing lua vim/shared.lua:0: after the second argument: expected table, got nil`

Have all the dependencies and updated them all, used Plug to install both barbecue and it's dependencies. Still popping up this error:

E5108: Error executing lua vim/shared.lua:0: after the second argument: expected table, got nil
stack traceback:
        [C]: in function 'error'
        vim/shared.lua: in function 'validate'
        vim/shared.lua: in function 'tbl_deep_extend'
        ...oload/plugged/barbecue.nvim/lua/barbecue/config/init.lua:21: in function 'apply'
        ...vim/autoload/plugged/barbecue.nvim/lua/barbecue/init.lua:65: in function 'setup'

Looks like the argument table wasn't used. Referring to these two:

function Config.prototype:apply(cfg)
  self.user = vim.tbl_deep_extend("force", self.template, cfg)
end
function M.setup(cfg)
  config:apply(cfg)
  --- ...

[Enhancement] Hide or map certain directories and paths

Firstly, what a fantastic plugin this is and thanks for a well put together README.

With the VS Code equivalent winbar, you have the benefit of having a smaller font to the rest of the editor; this allows for you to fit more "context" into the bar. We don't have that luxury in Neovim and everything is the same size, making space that little bit more precious.

If I take my dotfiles as an example:

Screen Shot 2022-11-03 at 09 03 24@2x

When editing them, I am pretty much always in the ~/.config/nvim/lua namespace. I'd like to omit that from the winbar or perhaps map it to something like Neovim, to save space. If I deviate from that, then just display the path as-is.

">" in the beggining of the filename

1664606467
i dont know why that ">" appears at the beginning of the winbar on some files

nvim-version

NVIM v0.9.0-dev-1-g4396c3ef2
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

Got Error while Start "lua\barbecue\utils.lua:37: attempt to index local 'str' (a nil value)"

on commit 8249ba2:

Error executing vim.schedule lua callback: ...e\pack\packer\start\barbecue.nvim/lua\barbecue\utils.lua:37: attempt to index local 'str' (a nil value)
stack traceback:
...e\pack\packer\start\barbecue.nvim/lua\barbecue\utils.lua:37: in function 'str_len'
...ack\packer\start\barbecue.nvim/lua\barbecue\ui\entry.lua:52: in function 'len'
...site\pack\packer\start\barbecue.nvim/lua\barbecue\ui.lua:200: in function <...site\pack\packer\start\barbecue.nvim/lua\barbecue\ui.lua:174>

An error occurred after updating the plug-in.

An error occurred after updating the plug-in.

Error executing vim.schedule lua callback: ...acker/start/barbecue.nvim/lua/barbecue/ui/components.lua:26: invalid key:
stack traceback:
        [C]: in function 'nvim_set_hl'
        ...acker/start/barbecue.nvim/lua/barbecue/ui/components.lua:26: in function 'get_file_icon'
        ...acker/start/barbecue.nvim/lua/barbecue/ui/components.lua:110: in function 'get_basename'
        ...site/pack/packer/start/barbecue.nvim/lua/barbecue/ui.lua:62: in function 'create_entries'
        ...site/pack/packer/start/barbecue.nvim/lua/barbecue/ui.lua:146: in function <...site/pack/packer/start/barbecue.nvim/lua/barbecue/ui.lua:135>

[FEAT]: Don't resolve paths to symlinked folders

Requirements

  • This feature isn't just a vague idea and can have a good practical solution.
  • I'm completely sure that this feature fits into this plugin.
  • I'm willing to implement this through a PR.

Problem

I have my notes at ~/notes which are symlinked to an NTFS SSD. When I open my notes, the breadcrumbs show the path to the SSD. It looks a bit weird as it was ~/notes which I opened and not the SSD path.

Solution Suggestion

The solution would be not to resolve the symlink of the CWD.

image

So in the image, instead of the full SSD path, the breadcrumbs should show:

notes > personal > index.norg

Workaround

No response

[BUG]: Handle File Path '\\' under Windows

Requirements

  • I have scammed other issues to see if this bug has already been reported.
  • I'm fully certain that this is not a breaking change, see the latest release.
  • This plugin and its dependencies are up to date with the latest commit.
  • I'm willing to fix this through a PR.

Expected Behavior

In windows cmd/powershell, file path is not separated by '/', but it's a '\'.
Expect this plugin split path correctly under windows.

Actual Behavior

The file path splits not actually working:
image

Neovim Version

latest stable: 0.8.2

Minimal Configuration

local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "--single-branch",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  -- do not remove the colorscheme!
  "folke/tokyonight.nvim",

  {
    "utilyre/barbecue.nvim",
    dependencies = {
      "neovim/nvim-lspconfig",
      "SmiteshP/nvim-navic",
      "nvim-tree/nvim-web-devicons",
    },
    config = function() 
      require("barbecue").setup()
    end,
  },
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

-- add anything else here
vim.opt.termguicolors = true
-- do not remove the colorscheme!
vim.cmd([[colorscheme tokyonight]])

Reproduction

use lazy.nvim to install barbecue and neo-tree.nvim, open this plugin project and will see it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.