utilyre / barbecue.nvim Goto Github PK
View Code? Open in Web Editor NEWA VS Code like winbar for Neovim
License: MIT License
A VS Code like winbar for Neovim
License: MIT License
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
Winbar to show icons
Winbar only shows rectangles in place of icons
0.8.3
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,
},
}
install
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>
we can add a jumplist before the navigate function
-- 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()
I execute :Barbecue
command with no arguments and it displays a list of command to execute.
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
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>
}
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
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]])
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 ππ»
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.
The solution would be not to resolve the symlink of the CWD.
So in the image, instead of the full SSD path, the breadcrumbs should show:
notes > personal > index.norg
No response
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?
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
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
No response
heres the plugin link - https://github.com/is0n/jaq-nvim
There shouldn't be any error from barbecue, when calling the CodeActionMenu command.
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)
NVIM v0.9.0-dev-781+gda671b21c
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]])
Just use CodeActionMenu command when LSP gives you a code-action
setup theme overrides base46 (https://github.com/NvChad/base46)
You can add feature. (theme=off) does not allow overriding.
No response
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>
Winbar should stay on-screen as shown in the example gif
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
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)
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]])
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
nvim-navic
example in my colorscheme)lualine
which is somethiing I accept as it is one of the most popular plugins in the Neovim communitySummary
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.
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!
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)
--- ...
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 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.
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>
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.
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
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.
Configuring the load order of plugins. If barbecue loads first, the colorscheme plugin correctly overrides the hl groups as expected.
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:
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.
sometimes when navigating, navic returns an empty string, and then theres an empty winbar covering up text
when navic returns an empty string, the winbar should toggle its visibility
No response
I'm trying out barbecue as it offers minimal design (and works differently than my version of settings with Lualine).
However I wish winbars on inactive windows to dim like how Lualine does.
My Barbecue and Lualine setup can be found at ryuheechul/dotfiles@c34b6c5 for a reference
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. β€οΈ
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.)
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
}
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
dirname
, filename
, and context
.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.
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.
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!
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.
In windows cmd/powershell, file path is not separated by '/', but it's a '\'.
Expect this plugin split path correctly under windows.
The file path splits not actually working:
latest stable: 0.8.2
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]])
use lazy.nvim to install barbecue and neo-tree.nvim, open this plugin project and will see it.
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.
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...
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.
after changing the theme (even changing to the same theme):
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.
Thanks for the awesome plugin!
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.
Described above.
No response
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
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
})
No response
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.
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.
No error
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>
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
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]])
/opt/homebrew/Cellar/neovim/0.9.0/share/nvim/runtime
)nvim -u repro.lua lua/vim/filetype.lua
['.*%.[Cc][Ff][Gg]']
blockE539: Illegal character <[>
['.*%.git/.*']
blockE539: Illegal character <g>
Haven't tried with nvim-navic
only.
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:
(Disabling barbecue fixes the problem, which makes me think it is causing that behavior, may be a conflict with another plugin though)
Thanks!
Being able to call require("barbecue.ui").navigate(2)
like it's described in the docs
barbecue.nvim/doc/barbecue.txt
Line 119 in c6cb480
calling the function fails because it has been removed in d8dad18
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"
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]])
:lua require("barbecue.ui").navigate(1)
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.
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)
NVIM v0.9.0-dev-810+gb8288df99
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]])
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.