pacha / vem-tabline Goto Github PK
View Code? Open in Web Editor NEWA lightweight Vim/Neovim plugin to display buffers and tabs in the tabline
License: MIT License
A lightweight Vim/Neovim plugin to display buffers and tabs in the tabline
License: MIT License
Hello,
If you simply open vim
without any file and start to edit the empty buffer, the [+]
modified flag is displayed in the status line (assuming it's configured to display it), but not in the Vem Tabline (no asterisk after "[No Name]"). However, echo &modified
returns 1
, as it should.
If you save the file and then keep editing it, the flag is displayed.
Best regards,
Dupond
Hello,
I've installed the plugin, but I'm not getting the
| buffer1 | buffer2* | buffer3 | | 1 | 2 | 3 |
format at the top. It's like the plugin doesn't take effect at all.
I do get a buffer list per tab (with only current buffer displayed), but on the right the close (X) button is displayed. That is just the usual tabline format.
I'm using neovim ver v0.4.4.
What can I do to fix this, to actually enable the plugin?
Here's my init.vim: https://github.com/robcsi/dotfiles/blob/master/nvim/.config/nvim/init.vim
Thanks
Hello,
It would be nice if the separator between buffer names was customizable, e.g. with a ' | ' vertical bar.
Here's my use case: for the moment, when you decide to underline the active buffer, it will also underline two empty spaces on the left and on the right (and the tabline grows fast with all these spaces between buffer names), so being able to customize it (e.g. with a single space) would be a nice addition.
Obviously, if you find it's not worth it, please feel free to close this.
Best regards,
Dupond
Nice plugin! I'm still debating whether it's worth using this on top of Ctrl+P. I definitely like the fact that it only takes one line though, vs MiniBufExplorer.
One odd behaviour I noticed is:
vim file1.txt file2.txt
:split
file1.txt + 1 more
instead of listing file2.txt
as well.Hello!
For the moment, when a buffer hasn't been saved, its name in the status line appears in the local language (e.g. for me it's [Aucun nom]
in french), but it also appears in english in the tabline (where it's called [No Name]
), which makes no sense, since both refer to the same buffer, but with a different "name" (or, to be more precise, indicating that it has no name in two different languages)...
It appears that Vem Tabline defines this name in the autoload/vem_tabline/buffers.vim
file, on line 119:
" empty name
if path_parts_count == 0
let buffer_item.name = '[No Name]'
continue
endif
So it would be nice if the buffer_item.name
variable could be configured in the vimrc
file.
Edit: maybe that's why some plugins with functionalities close to (but not as good as) Vem Tabline choose to use *
(an asterisk) as a name for an unnamed buffer...
Thanx for your great plugin!
Best regards,
Dupond
I get the following error when trying to call DeleteCurrentBuffer
:
Error detected while processing function DeleteCurrentBuffer:
line 2:
E121: Undefined variable: vem_tabline#tabline
E15: Invalid expression: vem_tabline#tabline.get_replacement_buffer()
I'm using NVIM v0.4.3
The documentation says that when using let g:vem_tabline_show_number = 'none'
or 'buffnr'
, the :buffer
command should be used for switching buffers, while :VemTablineGo
should be used when using the 'index'
option.
However, VemTabLineGo
is defined as follows
" User function to switch buffers
function! VemTablineGo(tagnr) abort
try
let buffnr = g:vem_tabline#buffers#section.tagnr_map[a:tagnr . g:vem_tabline_number_symbol]
exec 'buffer' . buffnr
catch /E716:/
exec 'buffer ' . a:tagnr
catch //
echoerr "VemTabline: Buffer " . a:tagnr . " does not exist"
endtry
endfunction
because of the catch /E716:/
, if the number being passed is not one of the buffer indices, the function won't fail as long as there's a buffer whose number matches the passed one. By buffer index I mean the one displayed in the tabline when using the 'index'
option, and by buffer number I mean the one shown by :ls
.
I think if the user wants to switch buffer by its number he/she should use :buffer
, while :VemTablineGo
should be reserved for switching buffers by index.
TL;DR
E716
shouldn't be catched in VemTablineGo
. If the number passed is not one of the indices, the function should be left free to fail.
Thanks for this plugin! I was always missing reorderable buffer tabs since my swticht to vim.
I encountered two problems when working with splits:
This is my key map for vem-tabline:
nmap <S-Left> :call vem_tabline#tabline.move_buffer('left')<CR>
nmap <S-Right> :call vem_tabline#tabline.move_buffer('right')<CR>
nmap <C-Left> :call vem_tabline#tabline.select_buffer('left')<CR>
nmap <C-Right> :call vem_tabline#tabline.select_buffer('right')<CR>
When using the vim floaterm plugin, after closing a floating terminal (to test this set g:floaterm_autoclose
to 2, then call :FloatermNew sh
, then exit
the shell), the tabline disappears.
After a few seconds it reappears automatically, but it's still annoying that it does that. I've tested other tabline plugins and they don't seem to have this particular problem.
Can this be fixed?
Edit: in general the tabline doesn't disapper, however the "tab" with the current buffer does. The tabline disappears if there are only two buffers one, since when one if them disappears the whole tabline is hidden.
My feature request is to add default mapping capability for buffers in a similar way to Airline.
The context is that I use airline's tabline to display all buffers. I looked at vem-tabline because airline doesn't have the ability to reorder buffers in the tabline. This would be really useful when I have a large number of buffers open but want to bring 3-5 together to edit them.
Vim-airline has one significant convenience. It creates an internal list of the buffers which can be displayed on the tabline: so you see [N][buffer name]. It sets up Mappings for them (https://github.com/vim-airline/vim-airline/blob/ea7f5d53135db890088666bfb6627e7c6b7388e1/doc/airline.txt#L918). As buffer numbers are fixed, the numbers it displays is an "internal number" and it maps this to the actual buffer number. The effect is that you can see that "4" on the tabline is a particular buffer and then use the mapping (1 ... 9/0) to immediately jump to that buffer.
Buftaline may have an [alternative](To switch buffers by their ordinal number (https://github.com/ap/vim-buftabline/blob/14d208b1fa5f4308383e3ce429d57c84423029f9/doc/buftabline.txt#L77) implementation.
This is more efficient than anything else I know of when you have long running sessions with a large number of buffers.
When viewing two splits and then collapsing to a single split using :only
results in the following error when trying to cycle to the next buffer:
Error detected while processing function 7[5]..8:
line 10:
E16: Invalid range: 2wincmd w
Hello,
Using Vem Tabline, if I open vim with both a file and a folder (e.g. vim myfile.txt myfolder/
) then "myfile.txt" and "myfolder" are displayed in the tabline, but switching between them (using:bnext
and :bprev
) doesn't update the status of the tabline: the folder name always appears as unselected.
Also, is there a way to change the colors of the numbered tabs displayed on the right of the tabline?
Congrats and thanx very much for this great plugin!
Best regards,
Dupond
VemTablineLocationSelected
doesn't seem to be implemented, although it's in the documentation.
also, a VemTablineLocationShown
would be useful as well. I'll try to do this if you don't already have it uncommitted somewhere, although I haven't really looked into the code yet.
A common use case for me is to have a bunch of files open, but to be mostly bouncing between two of them. It would be nice to be able to say
let mapleader ,
nmap <leader>, <Plug>vem_last_buffer-
And then type ,, to bounce between the most recent two files
Hello!
Vim gives the ability to customize the status bar, so I have set it so that it shows the full directory of the current file, followed by the file name, in the usual form, e.g. ~/my_folder/myfile.txt
; I personally finds it easier to read than myfile.txt@my_folder
, so it would be nice if there could be a config option that would allow to not display the directory name in the tabline. I hope it makes sense.
In the same spirit, the asterisk added to the buffer/tab name to indicate that it has been modified might also be redundant with the [+]
that can be added in the status bar in certain configurations. So may I also suggest to add an option to disable this modified indicator?
Those are just some suggestions of course, please feel free to close this if you find it's not in the scope of your plugin. I'd be sorry to give you the impression that I somehow "spam" your repository issues, mostly since I do find that your plugin is great!
Thanx for reading,
Best regards!
The documentation mentions
For example you could set your mappings like:
>
nmap <leader>h <Plug>vem_tabline_move_buffer_left-
nmap <leader>l <Plug>vem_tabline_move_buffer_right-
nmap <leader>p <Plug>vem_tabline_prev_buffer-
nmap <leader>n <Plug>vem_tabline_next_buffer-
<
But the actual mappings are
nmap <silent> <Plug>vem_prev_buffer- :call vem_tabline#tabline.select_buffer('left')<CR>
nmap <silent> <Plug>vem_next_buffer- :call vem_tabline#tabline.select_buffer('right')<CR>
nmap <silent> <Plug>vem_move_buffer_left- :call vem_tabline#tabline.move_buffer('left')<CR>
nmap <silent> <Plug>vem_move_buffer_right- :call vem_tabline#tabline.move_buffer('right')<CR>
so the mappings in the documentation don't work ๐
Basically title. This would mean a cleaner .vimrc
for everyone using this plugin, since instead of
nmap <silent> <Leader>x :call DeleteCurrentBuffer()<CR>
function! DeleteCurrentBuffer() abort
let current_buffer = bufnr('%')
let next_buffer = g:vem_tabline#tabline.get_replacement_buffer()
try
exec 'confirm ' . current_buffer . 'bdelete'
if next_buffer != 0
exec next_buffer . 'buffer'
endif
catch /E516:/
" If the operation is cancelled, do nothing
endtry
endfunction
one could simply have
nmap <Leader>x <Plug>vem_delete_buffer-
Once again thanks for this great plugin!
If I reload a a session (for example after restarting vim), then the buffers get ordered in accordance to last-viewed.
Is any way to save/load the current layout of the buffers along with a session?
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.