ap / vim-buftabline Goto Github PK
View Code? Open in Web Editor NEWForget Vim tabs – now you can have buffer tabs
Home Page: http://www.vim.org/scripts/script.php?script_id=5057
License: MIT License
Forget Vim tabs – now you can have buffer tabs
Home Page: http://www.vim.org/scripts/script.php?script_id=5057
License: MIT License
Hi, thanks for the plugin!
Is it possible to show netrw buffer too?
Currently its not showing and surprise me when I do :bp
the buffer switch to netrw buffer, not the buffer on tab list.
Thanks.
C.f. #12
When I start vim (without a specific argument file), if i run the Explore command on a [No Name] buffer, I got this error:
Error detected while processing function buftabline#render:
line 104:
E684: list index out of range: 0
Press ENTER or type command to continue
Error detected while processing function buftabline#render:
line 103:
E116: Invalid arguments for function substitute(tabs[0].label, lpad, ' ', '')
Press ENTER or type command to continue
Hello, would like some help integrating devicons, assuming it is possible.
Using the WebDevIconsGetFileTypeSumbol()
, from https://github.com/ryanoasis/vim-devicons#developer, I can replace line 110, within buftablime.vim from this:
let tab.label = lpad . get(tab, 'pre', '') . tab.label . ' '
to this:
let tab.label = lpad . get(tab, 'pre', '') . tab.label . ' %{WebDevIconsGetFileTypeSymbol()} '
.
It mostly works, except that all buffers get the same icon as the current. *sigh. I'm not sure how to address this, and would greatly appreciate your help, assuming it's possible.
Thank you.
Could really be useful for someone who uses fzf to switch buffers in MRU fashion.
I propose changing buffer numbers in ordinal mode with subscript notation as in screenshot above:
This has 2 advantages:
I can make a PR if you would like to accept this change.
I typically invoke a help topic with :tab help topic
because I prefer this unmixed, full terminal view. But this causes bad things to happen with buftabline enabled. Tab labels appear to duplicate, or disappear, and navigation with bnext misbehaves.
I see that help buffers get filtered in user_buffers()
but I was unable to successfully modify this for my purposes.
Is it possible to add a global option to allow for help
in its own tab? Perhaps it would be desirable to generalize this option so people can decide if they want to see other buftypes
in their own tabs?
Would love to see a mapping for something like Chromes last tab. So in a mac
Cmd-<number>
takes you to the desired tab, like buftabline, but if you have more than 9 tabs open and pressCmd-9
it takes you to the last tab.Does anyone else uses this?
I'm making my own custom neovim package and and I'm trying to install this globally.
It should be as simple as putting "https://raw.githubusercontent.com/ap/vim-buftabline/master/plugin/buftabline.vim" in usr/share/nvim/runtime/autoload/ right ? Because I can't seem to get it to work.
It works without problems when I use something like vim-plug.
Hi! Love buftabline
, its great.
#61 already mentioned something similar, but is it possible to order the buffer-tabs alphabetically by file name? So, opening a new tab would just insert the buffer into the correct, ordered space. That, or a function that orders the tabs.
Is this possible already? Or would we need a new PR?
Thanks for the plugin :)
Can you advise me on how I can move the indicator to the end of the file name ?
I've tried editing the plugin code itself but due to my limited viml skills, I can't get it to work.
Thanks.
Lately I'm finding myself using buffer numbers in various :b
commands, but I still like ordinal numbering for switching between buffers using Buftabline. Would you be open to a g:buftabline_numbers
option that shows both?
I'm thinking it would look something like: 1 foo.txt [1] | 2 bar.txt [7] | 3 baz.txt [2]
. If you're open to this I'd be glad to try implementing it myself, but I wanted to ask first since it could be treading on the ground of #35.
Hi. I really like your plugin. Thanks a lot for your work. I am wondering if you have plans to work on it further or if this project is dead?
With the current font in my uxrvt-unicode terminal the separator does not look good (it does in gvim. Reading the source code I stopped at this line:
let lpad = g:buftabline_separators ? nr2char(0x23B8) : ' '
I think it would be nice to allow some other character via some globar variable like:
g:buftabline_separator_character
This is a really peculiar bug that only happens sometimes, and I'm not even sure buftabline is the responsible party. I have an autocmd set up to run Neomake on every BufWritePost. If there are errors, they get populated into the location list. If I correct the errors, save again, and Neomake finds no errors remaining, it will close the location list, which somehow makes the tabline disappear. Here's a terrible quality gif to demonstrate:
This is on Neovim 0.2.1 FWIW. I've tried all manner of ways to reproduce this and have yet to track down the root cause. I have been able to reproduce it without using Neomake (just by using laddfile somefile.txt
, lopen
and lclose
). I've looked through buftabline's source and nothing has jumped out at me as being an obvious culprit, but I can't claim to fully understand everything it does. Mostly I'm just reporting it here as a first step, to see if you have any thoughts.
I am used to switch buffers by specifying their numbers instead of pressing :bn
or :bp
shortcut key repeatedly. There is an implementation of this feature in airline which I am currently using:
Is it possible to add this feature in vim-buftabline?
Would you merge it if I make a PR?
I'm using the latest nvim 0.4 + windows10(64bit).
This is the result when opened two buffers with:
:badd aaa
:badd bbb
My config in vimrc:
Plug 'ap/vim-buftabline'
let g:buftabline_show=1
let g:buftabline_numbers=2
let g:buftabline_indicators='on'
Why there is a tabline, not buffer line ? How to make it same as in the demo screenshot? Thanks.
I wish to disable vim-buftabline for certain file types, but setting let g:buftabline_show = 0
have no effect. How can I do this?
Hi, awesome plugin!
I've noticed that the listed tabs only have the last character in the filename listed ('c' for vimrc; 'm' for autoload.vim). This only seems to happen in Tmux right when I open vim. If I source my vimrc, then it solves the issue for that instance only. Works fine when not in Tmux, however. Not a big deal, just a minor inconvenience.
:bnext
/ :bprev
to switch buffer → okIs there a way to do this?
This is probably user error, and not a bug, but when I have buffers open, :bprev and :bnext work as expected, but when I do :e to get a file list, the file list becomes a buffer that I can not :prev.
i.e. I can cycle past it using next, but previous doesn't work. Also, the "tab" at the top isn't highlighted when I'm viewing the ":e" buffer.
Any ideas on how I'm supposed to be handling this situation? Thanks.
Hi,
could you add '+' to the end of the filename in buftabline if the file is modified?
That would help me a lot.
Thanks for the great plugin.
This was added in NeoVim 0.1.2:
@ N For 'tabline': start of execute function label. Use %X or %T to end the label, e.g.: %10@[email protected]%X. Clicking this label runs specified function: in the example when clicking once using left mouse button on "foo.c" "SwitchBuffer(10, 1, 'l', ' ')" expression will be run. Function receives the following arguments in order: 1. minwid field value or zero if no N was specified 2. number of mouse clicks to detect multiple clicks 3. mouse button used: "l", "r" or "m" for left, right or middle button respectively; one should not rely on third argument being only "l", "r" or "m": any other non-empty string value that contains only ASCII lower case letters may be expected for other mouse buttons 4. modifiers pressed: string which contains "s" if shift modifier was pressed, "c" for control, "a" for alt and "m" for meta; currently if modifier is not pressed string contains space instead, but one should not rely on presence of spaces or specific order of modifiers: use |stridx()| to test whether some modifier is present; string is guaranteed to contain only ASCII letters and spaces, one letter per modifier; "?" modifier may also be present, but its presence is a bug that denotes that new mouse button recognition was added without modifying code that reacts on mouse clicks on this label. Note: to test whether your version of Neovim contains this feature use `has('tablineat')`.
I wanted to change the tab colors so that the current tab is highlighted brighter:
highlight BufTabLineCurrent cterm=NONE ctermbg=15 ctermfg=8 gui=NONE guibg=#ffffff guifg=#d70000
doing so made the underline of the current tab appear to be colored over:
Obviously not the most important bug in the world but I thought I would bring it to your attention.
If you start Vim opening multiple files (e.g.: vim file1 file2
), only the current buffer name displayed. It's like the plugin is not properly updated.
Not sure if that would be the ideal fix, but if I change BufAdd
in buftabline.vim#L166 to be BufEnter
, then it works fine.
How do i remove the underline off the buffernames like shown in your preview screenshot?
First off great plugin, really enjoying using it. Would love the ability to custom color the modified glyph, by default is +
. Perhaps like this
hi BufTabLineModified guibg=XXXXXX guifg=XXXXXX etc...
Right now if two buffers are open in a split, both names are highlighted in the tabline, no matter which buffer the cursor is in. Can there be an option to highlight the name of only the one with the cursor?
The one thing I found missing in this buffer bar compared to airline's buffer bar is an indicator showing if a file is changed or read only by some indicator in the tab. Airline uses a ‘+’ to indicate change and (I think) a ‘-’ to indicate read-only. It would look like this:
I have implemented this for myself already, so if you agree I can submit a PR.
Hi, is there a simple way to hack the plugin in order to only show the buftabline when more than 1 buffer is opened?
Thanks!
Hi,
Can you please add the move functionality. Vim already has this for tabs with :tabmove but this dose not work your plugin. This is extremely useful when one has many tabs/buffers and wants to sort the order in the tabline.
This is the only thing missing form, otherwise, awesome plugin!
Hey guys,
I've been finding this very disturbing for quite a while. I often work with splits and multiple buffers. In that kind of situations, the higlighting is very unintuitive: the inactive split buffers are much more emphasized (buffer name has a background color) than the active one (buffer name font color is set).
For instance :
What would be the best way to deal with this? Change the class used for highlighting? Make it a parameter? Any other idea?
Instead of these
nmap <leader>1 <Plug>BufTabLine.Go(1)
nmap <leader>2 <Plug>BufTabLine.Go(2)
nmap <leader>3 <Plug>BufTabLine.Go(3)
nmap <leader>4 <Plug>BufTabLine.Go(4)
nmap <leader>5 <Plug>BufTabLine.Go(5)
nmap <leader>6 <Plug>BufTabLine.Go(6)
nmap <leader>7 <Plug>BufTabLine.Go(7)
nmap <leader>8 <Plug>BufTabLine.Go(8)
nmap <leader>9 <Plug>BufTabLine.Go(9)
nmap <leader>0 <Plug>BufTabLine.Go(10)
I would like to have a simple maping for <space>
which would take a count parameter.
Then after invoking 5<space>
I would expect vim to switch to 5'th buffer according to the ordinal numbering g:buftabline_numbers = 2
.
I wouldn't bother, however I simply can't spend days reading Vim's documentation and figuring out its quirks just to do such simple thing 😞
EDIT: Great plugin btw!
This issue appears only when g:buftabline_show
is set to 1
.
To reproduce:
:h
, causing the buffer line to dissapearClosing the help dialogue didn't restore the buffer line for me. I had to BufDelete
all my buffers and then open two new ones for it to appear again.
I like the way bling/vim-bufferline displays buffer list in command bar but it lacks mappings options, make it hard to switch between buffers, any thought about it?
Say I have the following directory listing:
.
├── a
├── b
├── c
└── dir
├── a2
├── b2
└── c2
1 directory, 6 files
I open everything with vim *
:
I get my files and the dir/
listing as expected. But if I change to the dir buffer, the dir/
option in the tabline isn't highlighted.
I assume this is because that buffer is listed as "no name". Is this something that's actually possible to fix? If there's no buffer name, I can imagine that with multiple directories open it might not be possible to work out which was highlighted.
There’s no reason this couldn’t incorporate Vim tabs by just showing a | 1 | 2 | 3 |-style display at either end of the tabline. Clickable ’n’ all. They would not have names, just numbers, but that’s OK, Vim fakes that part too, and it’ll help keep the display compact since the space is needed for buffer labels.
Hey!
So far it seems like a great lightweight plugin. So much more performant than MiniBufExplorer and Airline. Thanks!
Would you mind improving the error message when calling <Plug>BufTabLine.Go
beyond the available buffers? Given 3 buffers, calling <Plug>BufTabLine.Go(4)
throws a two-line error with a prompt to press Enter at the end:
E684: list index out of range: 4
E15: Invalid expression: 'b'.buftabline#user_buffers()[4]
The "Press Enter" requirement from Vim is slightly too disruptive. Maybe limit that to a one-liner.
Thanks and cheers!
I've already posted about this over there (itchyny/lightline.vim#264), but I thought I'd drop a note here, as well:
Lightline.vim includes a beautiful tabline replacement, but it only shows the classic vim tabpages. I'd love to see some integration, if possible!
It would be very helpful if the buffer icons in the tabline could be reordered. Commands for moving the current buffer's icon to the left or right would be quite useful.
I understand that buffer icons are currently ordered by buffer numbers, which are assigned by vim and cannot be changed, but I would assume that it is possible to display the buffer icons in a different order.
p.s. thanks for making a slick plugin!
To avoid cramming everything possible into configuration options, allow the user to specify how tabs should be rendered, possibly by providing custom rendering code for tabs.
E:481 No range allowed
occurs when key mappings like noremap <Leader>1 <Plug>BufTabLine.Go(1)
are defined and typing 1<Leader>1
by mistake. To avoid this, simply insert <C-u>
into the noremap definition after :
.
vim-buftabline/plugin/buftabline.vim
Line 177 in 12f29d2
For more information, see :help N:
and https://vi.stackexchange.com/questions/9751/understanding-ctrl-u-combination :)
Weird things keep appearing in the tab line when goyo is activated.
See the following issue on the goyo repo:
junegunn/goyo.vim#171 (comment)
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.