nanozuki / tabby.nvim

A declarative, highly configurable, and neovim style tabline plugin. Use your nvim tabs as a workspace multiplexer!
MIT License
570 stars 20 forks source link

Add a close tab icon #36

Closed GabMus closed 1 year ago

GabMus commented 2 years ago

It would be nice to be able to close tabs using a close button, similar to how bufferline does it.

Here's an example showing what it looks like in bufferline (not my config):

image

nanozuki commented 2 years ago

Yes, it's in the plan. But I'm considering how to add new feature but not to break the configurable and customizable. I guess it won't take too long.

nanozuki commented 1 year ago

I rewrite the config API in case to easily add helper functions. For example in setup, you can add a close button by tab object:

line.tabs().foreach(function(tab)
  local hl = tab.is_current() and theme.current_tab or theme.tab
  return {
    line.sep('', hl, theme.fill),
    tab.is_current() and '' or '',
    tab.number(),
    tab.name(),
    tab.close_btn(''),
    line.sep('', hl, theme.fill),
    hl = hl,
    margin = ' ',
  }
end),

Detail: https://github.com/nanozuki/tabby.nvim#tab