-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a "more buffers" indicator + option to customize the tabpage section #1539
Comments
Thanks for the suggestions! 'mini.tabline' is one of those modules which I'd like to keep with as minimal config as possible. With that in mind:
I initially thought about that, but 4 extra cells doesn't look like a huge issue. Certainly not worth adding a new config entry for.
I also thought about doing that, but it seems a bit redundant. It is usually inferrable from the tabline content based on some visual clues:
That said, I think it would be interesting to see if reusing
You can use |
There's also that "Tab" is an English word... It's "Onglet" in french :) But, well, I understand it's not in your goals... Without adding an option, I think a simple
Is there something I could read so that I can understand what you mean? Thanks!
OK, I've spent an hour trying to adapt the code in your link, but it doesn't work. Here's what I have now in my
The Thank you very much for your help! |
The
Not sure why require('mini.tabline').setup({
format = function(buf_id, label)
local buftype = vim.bo[buf_id].buftype
if buftype == 'nofile' or buftype == 'acwrite' then return ' [No_name] ' end
return ' ' .. label .. ' '
end,
tabpage_section = 'right',
}) |
Well, I thank you very much for your help and for your time, but it doesn't work either. Your code doesn't work for me, the name of the empty buffer is still |
@Dupond Did you mean this? vim.api.nvim_create_autocmd({ "BufAdd", "BufEnter" }, {
callback = function(args)
if vim.bo[args.buf].buftype == "" and vim.api.nvim_buf_get_name(args.buf) == "" then
vim.bo[args.buf].buflisted = false
end
end,
}) |
@krovuxdev Sorry, I don't understand your answer.
I've added the following line to try to debug: It turns out that I've tested with the following minimal
It displays: I use Neovim in ArchLinux:
|
@Dupond, I think you said something like, "The name of the empty buffer is still |
Or this might also work for you: require('mini.tabline').setup({
format = function(buf_id, label)
if vim.bo[buf_id].buftype == "" then
return '[ No_name ]'
end
-- your other code
end
}) |
No, it doesn't:
|
Yes, this is because the initial buffer is a regular buffer (i.e. with empty string as 'buftype'). For the unnamed regular buffer 'mini.tabline' shows If you want to show require('mini.tabline').setup({
format = function(buf_id, label)
if vim.api.nvim_buf_get_name(buf_id) == '' then return ' [No_name] ' end
return ' ' .. label .. ' '
end,
tabpage_section = 'right',
}) For a more customized labels for unnamed buffers (like scratch and quickfix buffers, for example), you can check |
OK, thank you for your answer! Is it possible to combine this with the code in
That's not what I meant, but I think I've edited my answer too late for you to be able to see it:
|
Yes, it is possible. Replace the
Yes, I've read that. I don't think the plain |
Sorry, I don't know how to code :( Would it be:
or:
And should I edit this line:
Maybe:
OK I find it confusing, but you're the developer :) |
My genuine suggestion would be to have at least the basic understanding of Lua language and programming. I think Learn X in Y minutes for Lua is generally enough for basic understanding. There are also built-in resources for that: Without that basic understanding I am afraid there will be much less joy for you in using modern Neovim in general (not only customizing 'mini.nvim').
It would be something like this: require('mini.tabline').setup({
format = function(buf_id, label)
if vim.api.nvim_buf_get_name(buf_id) == '' then return ' [No_name] ' end
local suffix = vim.bo[buf_id].modified and '+ ' or ''
return ' ' .. label .. ' ' .. suffix
end,
tabpage_section = 'right',
}) |
Contributing guidelines
Module(s)
mini.tabline
Description
First of all, thank you very much for those great plugins!
mini.tabline
, the tabpage section is formatted as follows:Tab #/#
. It would be nice if it could be customized, or if it could simply be formatted as#/#
to have more space for the buffer names.<
and>
were displayed on the left and/or the right of the tabbar when other names exist on the left or on the right of the visible buffer names. That's what is used for example in the Vem Tabline plugin.*
sign displayed when an unnamed buffer is opened quite confusing: it's barely visible when you have many opened buffers; so an option to customize the name of an "unnamed buffer" would be great. For example[ No Name ]
would be much more easier to see in the tabline.Thank you very much!
The text was updated successfully, but these errors were encountered: