romgrk / barbar.nvim Goto Github PK
View Code? Open in Web Editor NEWThe neovim tabline plugin.
The neovim tabline plugin.
Description
Greetings!
I am experimenting with barbar.nvim some now, and am encountering an issue when attempting to open to close buffers.
If I load multiple buffers at initialization (e.g. nvim *.py
), no error is encountered and I can switch between buffers fine.
As soon as I attempt to close a buffer, however, or create a new one, I run into issues.
To Reproduce
Attempting to open a new buffer (e.g. :e tmp
):
Error detected while processing function bufferline#update[1]..bufferline#render:
line 5:
E5101: Cannot convert given lua type
E5108: Error executing lua error converting argument 2
Attempting to call :BufferClose
:
Error detected while processing function bufferline#update[1]..bufferline#render:
line 5:
E5101: Cannot convert given lua type
E5108: Error executing lua error converting argument 5
Similar errors arise when attempting to call other functions that result in new buffers being created such as :checkhealth
or :PlugUpdate
.
init.vim: khughitt/dotfiles/nvim/init.nvim
barbar.nvim section:
# barbar.nvim loaded via vim-plug
nnoremap <silent> <leader>bd :BufferClose<CR>
nnoremap <silent> <S-Tab> :BufferPrevious<CR>
nnoremap <silent> <Tab> :BufferNext<CR>
nnoremap <silent> <S-left> :BufferPrevious<CR>
nnoremap <silent> <S-right> :BufferNext<CR>
I've tried disabling other plugins that seemed like they might conflict with barbar.nvim (airline, denite, etc.), but so far, no luck.
Creating a clean config and going through plugins one-by-one or batch-by-batch could work, but would likely take a lot of time, so I thought I would post here first in case you have any insights into what the problem might be?
Informations
Forgot to port them during the lua rewrite.
Hey,
thanks for this cool plugin. Looks pretty neat!
Description
The icons are drawn with a wrong background color. And then there is something awkward drawn at the end of the last segment. I don't know where these colors come from.
Please look at the screenshot and it will be quite obvious.
To Reproduce
init.vim:
let $PLUGIN_DIRECTORY = '~/.config/nvim/bundle'
set runtimepath^=$PLUGIN_DIRECTORY/nvim-web-devicons
set runtimepath^=$PLUGIN_DIRECTORY/barbar.nvim
" Set your options here
let bufferline = {}
highlight TabLineFill ctermbg=24 ctermfg=24
highlight BufferCurrent ctermbg=81 ctermfg=233
highlight link BufferCurrentMod BufferCurrent
highlight link BufferCurrentSign BufferCurrent
highlight BufferCurrentTarget ctermfg=197
highlight BufferInactive ctermbg=32 ctermfg=15
highlight link BufferInactiveMod BufferInactive
highlight link BufferInactiveSign BufferInactive
highlight link BufferInactiveTarget BufferCurrentTarget
highlight link BufferVisible BufferInactive
highlight link BufferVisibleMod BufferVisible
highlight link BufferVisibleSign BufferVisible
highlight link BufferVisibleTarget BufferInactiveTarget
highlight BufferTabpages ctermbg=9 ctermfg=9 " What is this for? No red visible...
Steps to reproduce the behavior:
Screenshots
If applicable, add screenshots to help explain your problem or to capture error messages.
Informations
Neovim version: v0.5.0-834-g7c4f34966
Description
When not using icons, the space (reserved to the icon?) is not colored,
thus is still set to the default color, black in this case.
To Reproduce
init.vim:
set runtimepath^=~/.local/share/nvim/plugged/barbar.nvim
set termguicolors
let bufferline = {}
let bufferline.icons = v:false
hi BufferCurrent guibg=red
hi BufferInactive guibg=gold
Open with nvim -u init.vim Foo Bar
.
Informations
NVIM v0.5.0-799-g186ba3b68
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Trying the plugin since it looks really cool but cannot get it working. When opening nvim or a buffer the tabline still shows the default look. I need to manually call silent! call bufferline#update()
to show it (silent is used to hide:
Error detected while processing function <SNR>26_check_modified[3]..bufferline#update[1]..bufferline#render[52]..<SNR>26_get_icon:
line 5:
E121: Undefined variable: g:lua_tree_icons
E15: Invalid expression: g:lua_tree_icons.default
)
Once the tabline shows properly, it does not get updated when I move to a different buffer. I need to manually call bufferline#update()
again.
Any ideas what can be wrong?
Im using latest neovim (HEAD) and have all requirements installed (+kyazdani42/nvim-tree.lua)
I'm enjoying this plugin a lot. Thank you for developing it! However, in order to maintain my moral superiority over my colleges, I use the Colemak layout rather than qwerty. Would you be willing to add an option to set the key order of bufferline.semantic_letters for those of us using alternate layouts?
I switched to this plugin from vim-airline's buffer tabs because this looks so much sexier. However, something I miss from airline's buffer tabs is the little indicator in the topright corner which shows up when you have multiple vim tabs open, indicating with a number which is the current one, for instance "tab 1/2
" as shown in my screenshot. I would love if this were added to this plugin.
I am not sure if this is an intended feature, but if I open vim and then open a second buffer like so:
and then switch to the [buffer 0]
tab using the :BufferPick
command, [buffer 3]
disappears and, I guess "collapses" into [buffer 1]
. This is somewhat understandable as if vim senses that I am switching from an empty buffer, it just deletes it. But the problem is that now when trying to quit out, I have to type :q
twice in order to exit from both buffers.
The weirder thing is that if I have more than two empty buffers open, say four for example, it only appears to collapse some of the buffers when switching.
Error detected while processing function 68_did_load:
line 12:
E216: No such group or event: WinClosed * call bufferline#update_async()
Press ENTER or type command to continue
Error detected while processing function 68_did_load[15]..bufferline#update[1]..bufferline#render[56]..68_get_icon:
line 8:
E5108: Error while calling lua chunk for luaeval(): ....vim/plugged/nvim-web-devicons/lua/nvim-web-devicons.lua:855: attempt t
o call field 'cmd' (a nil value)
Press ENTER or type command to continue
Error detected while processing function 68_did_load[15]..bufferline#update[1]..bufferline#render[56]..68_get_icon:
line 8:
E714: List required
Press ENTER or type command to continue
Error detected while processing function 68_did_load[15]..bufferline#update[1]..bufferline#render[56]..68_get_icon:
line 9:
E121: Undefined variable: icon
Press ENTER or type command to continue
Error detected while processing function 68_did_load[15]..bufferline#update[1]..bufferline#render[56]..68_get_icon:
line 9:
E15: Invalid expression: icon == '๎'
Press ENTER or type command to continue
Error detected while processing function 68_did_load[15]..bufferline#update[1]..bufferline#render[56]..68_get_icon:
line 12:
E121: Undefined variable: icon
Press ENTER or type command to continue
Error detected while processing function 68_did_load[15]..bufferline#update[1]..bufferline#render[56]..68_get_icon:
line 12:
E15: Invalid expression: [icon, hl]
Press ENTER or type command to continue
Error detected while processing function 68_did_load[15]..bufferline#update[1]..bufferline#render:
line 56:
E714: List required
Press ENTER or type command to continue
Error detected while processing function 68_did_load[15]..bufferline#update[1]..bufferline#render:
line 57:
E121: Undefined variable: iconHl
Press ENTER or type command to continue
Error detected while processing function 68_did_load[15]..bufferline#update[1]..bufferline#render:
line 57:
E116: Invalid arguments for function s:hl
Press ENTER or type command to continue
Error detected while processing function 68_did_load[15]..bufferline#update[1]..bufferline#render:
line 57:
E15: Invalid expression: status is 'Inactive' ? s:hl('BufferInactive') : s:hl(iconHl)
Press ENTER or type command to continue
Error detected while processing function 68_did_load[15]..bufferline#update[1]..bufferline#render:
line 58:
E121: Undefined variable: icon
Press ENTER or type command to continue
Error detected while processing function 68_did_load[15]..bufferline#update[1]..bufferline#render:
line 58:
E15: Invalid expression: icon . ' '
Press ENTER or type command to continue
Error detected while processing function 68_did_load[15]..bufferline#update[1]..bufferline#render:
line 86:
E121: Undefined variable: iconPrefix
Press ENTER or type command to continue
Error detected while processing function 68_did_load[15]..bufferline#update[1]..bufferline#render:
line 86:
E15: Invalid expression: clickable . separatorPrefix . separator . padding . iconPrefix . icon . namePrefix . name . padding .
' ' . closePrefix . close
Press ENTER or type command to continue
Error detected while processing function 68_did_load[15]..bufferline#update[1]..bufferline#render:
line 111:
E121: Undefined variable: item
Press ENTER or type command to continue
Error detected while processing function 68_did_load[15]..bufferline#update[1]..bufferline#render:
line 111:
E15: Invalid expression: item
Such as fugitive
Description
Error detected while processing function <SNR>17_did_load[15]..bufferline#update[1]..bufferline#render:
line 5:
E5108: Error executing lua ...share/nvim/plugged/barbar.nvim/lua/bufferline/render.lua:9: module 'nvim-web-devicons' not found:^@^Ino field package.preload['nvim-web-devicons']^@^Ino file './nvim-web-devicons.lua'^@^Ino file '/home/travis/build/neovim/bo
t-ci/build/neovim/.deps/usr/share/luajit-2.1.0-beta3/nvim-web-devicons.lua'^@^Ino file '/usr/local/share/lua/5.1/nvim-web-devicons.lua'^@^Ino file '/usr/local/share/lua/5.1/nvim-web-devicons/init.lua'^@^Ino file '/home/travis/build/neovim/bot-ci/build/ne
ovim/.deps/usr/share/lua/5.1/nvim-web-devicons.lua'^@^Ino file '/home/travis/build/neovim/bot-ci/build/neovim/.deps/usr/share/lua/5.1/nvim-web-devicons/init.lua'^@^Ino file './nvim-web-devicons.so'^@^Ino file '/usr/local/lib/lua/5.1/nvim-web-devicons.so'
^@^Ino file '/home/travis/build/neovim/bot-ci/build/neovim/.deps/usr/lib/lua/5.1/nvim-web-devicons.so'^@^Ino file '/usr/local/lib/lua/5.1/loadall.so'
To Reproduce
init.vim
set runtimepath^=~/.local/share/nvim/plugged/barbar.nvim
let bufferline = {}
let bufferline.icons = v:false
Informations
Neovim version:
NVIM v0.5.0-799-g186ba3b68
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Rendering mainly
Don't know if it is just a problem with my config or not. I am on NVIM v0.5.0-812-gd17e50879
.
Here is what happens
Description
The plugin just doesn't work with minimal configuration, a lot of errors.
To Reproduce
init.vim:
call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-sensible'
Plug 'kyazdani42/nvim-web-devicons'
Plug 'romgrk/barbar.nvim'
call plug#end()
Dockerfile:
FROM ubuntu:latest
ENV DEBIAN_FRONTEND=noninteractive
ENV DEBIAN_PRIORITY=critical
RUN apt update && apt install -y gnupg2 git curl python3 python3-pip
RUN apt update && \
apt install -y neovim && \
apt-get clean autoclean && \
apt-get autoremove --yes && \
rm -rf /var/lib/{apt,dpkg,cache,log}/
RUN python3 -m pip install pynvim neovim
WORKDIR /root
# Install vim-plug
RUN sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
RUN mkdir -p ~/.config/nvim && echo "call plug#begin('~/.vim/plugged')" > ~/.config/nvim/init.vim
RUN echo "Plug 'tpope/vim-sensible'\nPlug 'kyazdani42/nvim-web-devicons'\nPlug 'romgrk/barbar.nvim'\ncall plug#end()" >> ~/.config/nvim/init.vim
RUN nvim --headless +'PlugInstall --sync' +qall
CMD [ "nvim" ]
Steps to reproduce the behavior:
Screenshots
*** Ascii Cinema ***
https://asciinema.org/a/Tzys8WdZUCFKnaz2Ug5eBUWOu
Informations
Neovim version: 0.4.4
Instead of picking the next unassigned letter when a buffer is opened, we could instead try to assign it the first letter of it's name, then something else if that letter is already taken.
It would be very cool to have a way to scroll between all open tabs without switching to any buffers. It could be mapped to <S-ScrollWheelDown>
and <S-ScrollWheelUp>
for instance, or just some key. Looking through the code I saw this plugin already has some logic for setting scroll so it shouldn't be too complicated to expose it to users
Description
Question marks are shown instead of icons in tab bar.
To Reproduce
init.vim:
Plug 'kyazdani42/nvim-web-devicons'
Plug 'romgrk/barbar.nvim'
" Move to previous/next
nnoremap <silent> <C-h> :BufferPrevious<CR>
nnoremap <silent> <C-l> :BufferNext<CR>
nnoremap <silent> <C-x> :BufferClose<CR>
let bufferline = {}
let bufferline.icons = v:true
Information
Neovim version: v-0.5.0-df72640
This is on MacOS. I tried the plugin on a linux machine too and also there I did not get icons.
I tried running :lua require'nvim-web-devicons'.has_loaded(). This did not give any output.
The bar's background color also changes, from when there are only buffers (and no tabs open):
Is that intended?
Originally posted by @Iron-E in #22 (comment)
Making a new issue for this as requested. I currently have my eyes on this range as a potential problem area (although I don't really know for sure):
if layout.tabpages_width > 0 then
result = result .. '%=%#BufferTabpages# ' .. tostring(current_tabpage) .. '/' .. tostring(total_tabpages) .. ' '
end
-- vim.g.layout = {
-- scroll = state.scroll,
-- max_scroll = max_scroll,
-- layout = layout,
-- needed_width = needed_width,
-- accumulated_width = accumulated_width,
-- }
result = result .. hl('TabLineFill')
I think this because when you change the %=%
to something like %foo%
, the bar comes back at the end:
I'm admittedly unfamiliar with tabline syntax though.
Would be great to have mouse support. Sure, (n)vim users use the keyboard. However, for me personally, I tend to use a lot the mouse when I know I'm going to just be reading code for a long time, without writing/editing. It would be great to be able to traverse tabs/buffers using the mouse in this situation.
Thanks for considering!
https://github.com/moll/vim-bbye/blob/master/plugin/bbye.vim
I think it will be more intuitive for people.
For instance when you close a buffer but three are open and then the editor just closes.
Description
Error detected while processing function bufferline#pick_buffer:
line 1:
E5108: Error executing lua Vim(return):E5108: Error executing lua ...share/nvim/plugged/barbar.nvim/lua/bufferline/render.lua:105: attempt to call global 'slice' (a nil value)
How To Reproduce
init.vim
set runtimepath^=~/.local/share/nvim/plugged/barbar.nvim
set runtimepath^=~/.local/share/nvim/plugged/nvim-web-devicons
let bufferline = {}
let bufferline.icons = v:false
nnoremap <silent> <C-s> :BufferPick<CR>
Either use the above mapping or :BufferPick
causes the mentioned error.
Informations
NVIM v0.5.0-799-g186ba3b68
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
I've found some issues, which airline#extensions#tabline
doesn't have:
Dot directory
- Run
nvim .
- Tab name is
.
- Go to any directory
- Tab name has changed
nobuflisted
buffers
- Run
nvim .
(opensnetrw
)- Neovim starts with one tab "No Name" and after a few milliseconds the name is changed to
.
- Run
nvim .
(opensnetrw
)- Go to any directory
- New tab is opened (with name of directory) and after a few milliseconds it closed
- Run
nvim .
- Open new tab (
:tabnew
or:tabe filename
)- Go to previous tab (
<C-PageUp>
)netrw
tab doesn't have active flag
:e filename
:Explore
(setsnobuflisted
)- Tab "filename" doesn't have an active flag
- Press
C-O
(go back)- Tab "filename" have an active flag
:e dir1
(opens tab with no name):e dir2
(previous tab name has changed):e dir3
(previous tab name has changed)
:e .
:e .
(tab has closed)
No tabs
- Install
vim-startify
plugin- Run
nvim
- New tab "No Name" is opened and after a few milliseconds it closed
- Black tabline with vertical line on the left (maybe it's a UI bug)
I just found your Plugin and I really, really like it so far. In my current project I always have a split terminal at the button of my buffers (using neoterm) so my question is:
is it possible to set an option to exclude terminal buffers from the list?
Thanks in advance,
flo
I was trying the :BufferPick
feature as shown in your README:
Let's say our buffer is highlight.vim
and we press h
. In my nvim, this returns the input focus to the buffer (good) but doesn't clear the red letters from the bar. We made a choice (or mistake) to stay on the current buffer, so the state should return to normal.
nvim: 0.5.0-dev (current)
If this cannot be reproduced on your side, I'll glady add more information of course.
When too many tabs are open for all of them to fit on screen the current tab can end up hiding off screen. It would be nice if in this situation the plugin scrolled all tabs so that the current one becomes visible.
It would be nice if it had support for powerline rounded separators between buffers.
eg init.vim
should come before after/ftplugin/example.vim
For instance, when running nvim foo bar baz
in the shell, the buffer tabs order, i.e. baz
, bar
, foo
.
I tried to disable the close buttons using g:bufferline.closable
but I'm getting the error E121: Undefined variable: g:bufferline
when Neovim launches. What am I doing wrong? The following is my minimal config:
call plug#begin('~/.vim/bundle')
Plug 'kyazdani42/nvim-web-devicons' " Required by barbar.nvim
Plug 'romgrk/lib.kom' " Required by barbar.nvim
Plug 'romgrk/barbar.nvim' " Sexiest buffer tabline
call plug#end()
let g:bufferline.closable = v:false
When the number of buffers is enough to exceed the width of the window, you can get into situations where you current buffer is either partially or all the way off screen. It'd be ideal if the line would "scroll" so that the currently selected buffer is always fully on screen.
example of it being partially off screen:
(To this day, I have this problem on my own tabline impl)
Hi, fresh install and I'm seeing a ton of repeats of the following:
E121: Undefined variable: g:icons
E15: Invalid expression: status == 'Inactive' ? g:icons.bufferline_separator_inactive : g:icons.bufferline_separator_active
Am I missing a config someplace?
Ideas:
WarningMsg
foreground for modified buffersDescription
If option bufferline.icons
is not defined than plugin throws exception.
Error detected while processing function <SNR>67_did_load[15]..bufferline#update[1]..bufferline#render: line 5: E5108: Error executing lua ...g/dein/.cache/init.vim/.dein/lua/bufferline/get-icon.lua:19: attempt to call field 'get_icon' (a nil value)
To Reproduce
init.vim:
scriptencoding utf8
if &compatible
set nocompatible
endif
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/dein.vim
if dein#load_state('~/.config/dein')
call dein#begin('~/.config/dein')
call dein#add('~/.config/dein/repos/github.com/Shougo/dein.vim')
call dein#add('romgrk/barbar.nvim')
call dein#end()
call dein#save_state()
endif
" let bufferline = {}
" let bufferline.icons = v:false
Steps to reproduce the behavior:
let bufferline*
and it worksInformations
Neovim version: v0.5.0-799-g186ba3b68
barbar version: latest
PS. I've spent a half hour for finding this issue =)
I've noticed the plugin flashes really fast when starting up the plugin Startify. Not then end of the world but if you have an easy fix for that I would appreciate it.
Implement commands that allow to order tabs by dirctory, or by language, which is how I order them when I work.
I am really enjoying this plugin, however the only thing that seems to be missing, is being able to see the number next to the title of the tab.
In most situations, I have under 9 tabs, so being able to see the number allows me to use a :BufferGoto keybind easily and swiftly. Here is an example from my previous configuration without barbar.nvim:
This option could also be off by default, if this not something that other people want.
Description
I tried barbar.nvim on my Windows machine but I'm getting the following error:
Error detected while processing function bufferline#update[1]..bufferline#render:
Line 1:
E5101: Cannot convert given lua type
To Reproduce
init.vim:
call plug#begin('~/.vim/bundle')
Plug 'romgrk/barbar.nvim'
call plug#end()
Steps to reproduce the behavior:
Information
Ouput of :version
:
NVIM v0.5.0-496-gd2766b06c
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe /DWIN32 /D_WINDOWS /W3 /MD /Zi /O2 /Ob1 /DNDEBUG /W3 -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -DWIN32 -D_WIN32_WINNT=0x0600 -DINCLUDE_GENERATED_DECLARATIONS -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -IC:/projects/neovim/build/config -IC:/projects/neovim/src -IC:/projects/nvim-deps/usr/include -IC:/projects/neovim/build/src/nvim/auto -IC:/projects/neovim/build/include
Compiled by appveyor@APPVYR-WIN
Features: -acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM\sysinit.vim"
fall-back for $VIM: "C:/Program Files/nvim/share/nvim"
Run :checkhealth for more info
Hi. Thanks for the nice plugin. Would it be possible to hide barbar if only one buffer is open?
TBD:
Description
I tried configuring barbar
. When I open vim I see the following error:
E121: Undefined variable: g:bufferline
set runtimepath^=~/.config/nvim/pack/plugins/opt/barbar
let g:bufferline.icons = v:false
To Reproduce
If I set let g:bufferline.icons = v:false
manually after vim is open the setting is correctly recognized and applied.
Information
NVIM v0.5.0-812-gd17e50879
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.