mini.tabline: How to filter buffers #976
-
Hi, thanks for the plugins! Currently I'm customizing I checked the helpfile but couldn't find any information on how to filter it out. Could you please tell me a way to do it? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The 'mini.tabline' module is designed to show all listed buffers in order of their identifiers. Here "listed" buffer is a special term describing buffers with set 'buflisted' option; they are essentially the buffers which "should be listed". Preserving order is important because That said, recently there is a new require('mini.tabline').setup({
format = function(buf_id, label)
if vim.bo[buf_id].filetype == 'vim' then return '' end
return MiniTabline.default_format(buf_id, label)
end,
}) Unfortunately, I don't really understand what you mean by "LSP quickfix floating", so can not help with exact final condition for filtering out such buffers. But usually it is done by 'filetype' option (possibly together with 'buftype' option). Note, that I'd recommend to not filter out buffers based on your criteria, as the default behavior shown to be the most robust approach (as of now). |
Beta Was this translation helpful? Give feedback.
The 'mini.tabline' module is designed to show all listed buffers in order of their identifiers. Here "listed" buffer is a special term describing buffers with set 'buflisted' option; they are essentially the buffers which "should be listed". Preserving order is important because
:bnext
and:bprev
(or[b
and]b
from 'mini.bracketed') then traverse tabline in order.That said, recently there is a new
format
config value which can be used to finalize what text is used to show buffer in a tabline. You can use it to return empty string for buffers which you don't want to be shown in tabline. Here is an example which will not show buffers with 'filetype' equal to'vim'
: