Code Monkey home page Code Monkey logo

tabby.nvim's Issues

It seems that the `line.spacer()` doesn't work correctly

DEMO

no_align.mov

Description

Notice that when I toggled between tabs 1 and 2, the position of 1 and 2 changed. I think the culprit is that when the length of the current buffername changed, the spacer seems to still add the same number of spaces. In the demo, since the buffername plugins.lua is longer than [No Name], both 1 and 2 were pushed more to the right.

File icon

How can I config to show file icon on tabs.

Have buffers inside the tabline

I know that in the README, tabby.nvim is not supposed to be a buffers list but it also says that it is possible with low-level api...

Tabby.nvim focuses on a vim-style tab instead of buffers list, so tabby only displays the buffers in tabpage(although you can use low-level API to write a bufferline)

What would the configuration for this look like (assuming it's possible)?

Here's my config btw...

local filename = require('tabby.filename')
local util = require('tabby.util')

local hl_tabline = util.extract_nvim_hl('TabLine')
local hl_normal = util.extract_nvim_hl('Normal')
local hl_tabline_sel = util.extract_nvim_hl('TabLineSel')

local active_tab_hl = { fg = hl_normal.fg, bg = hl_normal.bg, style = 'bold' }
local inactive_tab_hl = { fg = hl_tabline.fg, bg = hl_tabline.bg }

local tabline = {
  hl = 'TabLineFill',
  layout = 'active_wins_at_tail',
  head = {
      { '', hl = { fg = hl_tabline_sel.fg, bg = hl_tabline_sel.bg, style = 'bold' } },
      { ' ', hl = 'TabLineFill' }
  },
  active_tab = {
    label = function(tabid)
      return {
        '' .. tabid .. '  ',
        hl = active_tab_hl,
      }
    end,
  },
  inactive_tab = {
    label = function(tabid)
      return {
        '' .. tabid .. '  ',
        hl = inactive_tab_hl,
      }
    end,
  },
  top_win = {
    label = function(winid)
      return {
          '' .. filename.unique(winid) .. ' ',
        hl = active_tab_hl
      }
    end,
    left_sep = { ' ', hl = 'TabLineFill' },
  },
  win = {
    label = function(winid)
      return {
          '' .. filename.unique(winid) .. ' ',
        hl = 'TabLine',
      }
    end,
    left_sep = { ' ', hl = 'TabLineFill' },
	},
}

require('tabby').setup{
	tabline = tabline,
}

[Feature] Functions to expose window manager mappings

First off great plugin!

As a window manager user I see these tabs like workspaces. It would be great to have functions to manipulate tabs. For example selecting a tab based on a number. So you can map something like <leader>1 to jump to the first workspace. What are your thoughts on this?

Rename tabpage

Rename a tab page, and provide a tool function to get it.

The tab icon is incorrect

The icons in lualine and nvimtree is correct, but tabby not.

image

Another problem is, if enable ctrlspace plugin, no any icon show, like this:

image

Weird redraw issue when entering command mode

When entering command mode, the characters used for line.sep are all drawn with broken highlights until some sort of event later on causes it to get redrawn. Cannot figure out what could be causing this.
vim_normal
vim_command

missing argument guibg=

Today after updating I got these error message:
Snipaste_2022-05-11_08-16-28

The error also appears with the default style.

Figured out, that hl.bg passes the vim.validate function (not nil) but is an empty string. Maybe we should check that too:

  if hl.bg ~= nil and hl.bg ~= "" then
    table.insert(cmd, 'guibg=' .. hl.bg)
  end

Tabby + Treesitter: wrong tabs highlighting

Hi!

There is a wrong Tabby tabs highlighting if Treesitter is installed:
Снимок экрана 2021-10-10 в 01 30 39

If I comment out the Treesitter and recompile the Packer script the tabs are looking as usual:
Снимок экрана 2021-10-10 в 01 32 53

(macOS, iTerm2, Neovim nightly)

Hide windows showing non-file buffers

There are certain tool windows, like file browsers and issues lister, that show up in the window list but don't represent actual documents. It might make more sense to hide them from the window list. It could be an option. What do you think?


screenshot

Filter certain window labels / titles from appering in the bar

A filter config key for certain windows to hide from the bar would be an useful addition.

An example would be the 'index' window label, when opening fugitives git status with :G or terminal window labels the user does not deem as valuable.

2021-12-28-140450_1501x70_scrot

On this pic, only the '[No name]' window label is useful to me.

no-nerd-font-example.lua: wrong tabs renumbering

Hi!

It seems there is wrong tab renumbering when using the 'no-nerd-font-example.lua' example.
Here are the screenshots:

  1. I'm opening an empty Neovim (the tab 1 was added automatically):

Снимок экрана 2021-10-11 в 02 08 44

  1. I'm creating second tab with :tabnew:

Снимок экрана 2021-10-11 в 02 09 18

  1. I'm switching back to the tab 1 using 'gt':

Снимок экрана 2021-10-11 в 02 09 41

  1. I'm deleting the tab 1 using :tabc. Note, the tab 2 was not renamed to 1:

Снимок экрана 2021-10-11 в 02 09 52

  1. I'm creating another tab with :tabnew. Now there are tabs 2 and 3, while I'm expecting to see tabs 1 and 2:

Снимок экрана 2021-10-11 в 02 10 03

As far as I remember this issue is not reproducible when you use the 'Nerd-fonts' Tabby. Is this a specific 'no-nerd-font-example.lua' bug? Can you reproduce this?

Scrollable?

Really love this pure tab plugin. I hate bufferline.

Are you planning to support scrollable feature just in case the tabs are too many or too long that cannot fit into the screen?

Thank you so much.

[Bug] Not finding tabby modules

Upon running require('tabby.filename') and require('tabby.util'), I get the errors module 'tabby.filename' not found and module 'tabby.util' not found.

Is that a bug or were they removed?

Add a close tab icon

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

Help: could not install Tabby properly

Hi!

I'm trying to install Tabby using the instructions (macOS, iTerm2, Neovim nightly, Packer).
Here is what I see after running :PackerInstall and :PackerCompile:
Снимок экрана 2021-10-06 в 13 11 07

And here is what I see after restarting Neovim:
Снимок экрана 2021-10-06 в 13 11 25

What am I doing wrong? (Quite a newbie here.)
Thanks!

Why it's `win.buf().id` not `win.buf.id`?

As title. First, I appreciate this beautiful plugin and have a good time doing the customization. But regarding the coding part, It took me some time debugging to realize that tabbywin.buf is actually a function instead of a field. That is, the working code looks kinda cumbersome:

line.wins_in_tab(line.api.get_current_tab()).foreach(function(win)
  if not vim.api.nvim_buf_get_option(win.buf().id, 'buflisted') then return {} end
--                                        ^here

(In this code I assumed win should mean tabby-win as per your documentation)


At first, this is more of an aesthetic problem with the code. But then I notice that your documentation also said tabby.buf.id. Could you elaborate more on this part?

Custom tab names don't persist across sessions

When renaming a tab through :TabRename, it won't persist after closing the editor and recovering the previous session. Instead, the default behavior is back, with the focused buffer's name as the tab name.

I don't actually know if it's possible to persist this information, I have very little insight into how vim sessions work.

Add option to choose truncate mode

Thanks for the great plugin, really enjoy it.

Currently when the screen width is too short the tabline is truncated on the left side, hiding the tabs. I would prefer to truncate the windows list instead. Is it possible? If not, can it be added?
A more global solutions, I'm thinking about, would be giving each tabline chunk some truncation priority field.
What do you think?

Small typo in README

Examples and Gallary

These are some awesome exmaples shared by tabby.nvim users! Also welcome to share your own!

Utils library

Provide a easy way to get useful information to render tabline.

Move assets folder into Wiki section

Since most plugin managers clone the git repository they should not have to download the assets of the plugin.

One solution is to move the assets to the built in wiki section of the GitHub repository. Since this is a separate repo the users don't have to download the assets, and you can still link to the files in the readme.

Either that or open an issue/pr and use that to upload images there and link to them.

Great plugin and it was an instant add to my config. Was thinking of writing one glad you did!

Doesn't use colours from Dracula theme

Somewhat surprisingly given how mature the Dracula theme is, it seems that tabby doesn't use colours from that theme, instead my tab bar has no selected tab highlights etc

Can confirm other themes work fine (e.g onedarkhalf).

Screenshot

In the preset, the color of the tab and the border color are inconsistent

image

enviroment:

Iterm2
NVIM v0.7.2
Build type: Release
LuaJIT 2.1.0-beta3

config:

  use {
      "nanozuki/tabby.nvim",
      config = function()
          require("tabby").setup({
                  tabline = require("tabby.presets").active_wins_at_tail,
              })
      end,
  }
-- theme
  use {
      "sainnhe/sonokai",
      requires = {
          'nvim-treesitter/nvim-treesitter'
      },
      config = function()
          vim.g.sonokai_style = "default"
          vim.g.sonokai_enable_italic = 1
          vim.cmd('colorscheme sonokai')
      end
  }

[Feature Request] Option to show tabline only if there are 'n' tabs open

Currently, tabby will show the tabline even when there's only one tab open. It'd be nice if you had the option to show it only when there are multiple tabs open, the same way it works with the vanilla one.

I think this could be implemented as an option like show_when_n_or_more_tabs. With the default 1, it'd always show the tabline. However when changed to 2, it'd only show the tabline when you have 2 or more tabs open, and changing to 3 would only show when there are 3 or more open.

[Bug] highlight group not found: TabbyHl___

I'm getting an error when starting tabby:

Error detected while processing function TabbyTabline:                                                                                          
line    1:                                                                                                                                      
E5108: Error executing lua ...packer/start/tabby.nvim/lua/tabby/internal/highlight.lua:29: Vim(highlight):E411: highlight group not found: TabbyHl___                                                                                                                                           
stack traceback:                                                                                                                                
        [C]: in function 'cmd'                                                                                                                  
        ...packer/start/tabby.nvim/lua/tabby/internal/highlight.lua:29: in function 'register'                                                  
        ...ck/packer/start/tabby.nvim/lua/tabby/internal/render.lua:93: in function 'highlight'                                                 
        ...ck/packer/start/tabby.nvim/lua/tabby/internal/render.lua:67: in function 'frag'                                                      
        ...ck/packer/start/tabby.nvim/lua/tabby/internal/render.lua:24: in function 'node'                                                      
        ...ck/packer/start/tabby.nvim/lua/tabby/internal/render.lua:65: in function
<...ck/packer/start/tabby.nvim/lua/tabby/internal/render.lua:57>                                                                                                                                            
        vim/shared.lua: in function 'tbl_map'                                                                                                   
        .../site/pack/packer/start/tabby.nvim/lua/tabby/tabline.lua:146: in function 'update'                                                   
        [string "luaeval()"]:1: in main chunk

It's quite inconsistent. It only happens on some startups, in others it just runs fine (feels like 50/50 chance). When the error happens, the tabline does not load correctly. Here's some screenshots of how the tab normally looks like, and how it looks like with the error:
normal
buggy

This is my full config:

local filename = require('tabby.filename')
local util = require('tabby.util')

local hl_tabline = util.extract_nvim_hl('TabLine')
local hl_tabline_sel = util.extract_nvim_hl('TabLineSel')
local hl_tabline_fill = util.extract_nvim_hl('TabLineFill')

local function tab_label(tabid, active)
	local icon = active and '' or ''
	local number = vim.api.nvim_tabpage_get_number(tabid)
local name = util.get_tab_name(tabid)
	if active then
		return string.format(' %s %d: %s ', icon, number, name)
	else
		return string.format(' %s %d ', icon, number)
	end
end

local tabline = {
	hl = 'TabLineFill',
	layout = 'tab_only',
	head = {
		{ '', hl = { fg = hl_tabline.fg, bg = hl_tabline.bg } },
		{ '', hl = { fg = hl_tabline.bg, bg = hl_tabline_fill.bg } },
	},
	active_tab = {
		label = function(tabid)
			return {
				tab_label(tabid, true),
				hl = { fg = hl_tabline_sel.fg, bg = hl_tabline_sel.bg, style = 'bold' },
			}
		end,
		left_sep = { '', hl = { fg = hl_tabline_sel.bg, bg = hl_tabline_fill.bg } },
		right_sep = { '', hl = { fg = hl_tabline_sel.bg, bg = hl_tabline_fill.bg } },
	},
	inactive_tab = {
		label = function(tabid)
			return {
				tab_label(tabid, false),
				hl = { fg = hl_tabline.fg, bg = hl_tabline.bg, style = 'bold' },
			}
		end,
		left_sep = { '', hl = { fg = hl_tabline_fill.bg, bg = hl_tabline_fill.bg } },
		right_sep = { '', hl = { fg = hl_tabline_fill.bg, bg = hl_tabline_fill.bg } },
	},
	top_win = {
		label = function(winid)
			return {
				--' > ' .. filename.unique(winid) .. ' ',
				'',
				hl = 'TabLine',
			}
		end,
		left_sep = { ' ', hl = 'TabLineFill' },
	},
	win = {
		label = function(winid)
			return {
				--' - ' .. filename.unique(winid) .. ' ',
				'',
				hl = 'TabLine',
			}
		end,
		left_sep = { ' ', hl = 'TabLineFill' },
	},
}

require('tabby').setup({
	tabline = tabline,
})

Error when installing

When I run :PackerSync I get the following error.
packer.nvim: Error running config for tabby.nvim: vim/shared.lua:0: after the second argument: expected table, got nil

Here is my config.

  use { "nanozuki/tabby.nvim",
    requires = "kyazdani42/nvim-web-devicons",
    after = "nightfox.nvim",
    config = function()
      require("tabby").setup({})
    end
  }

Tab label provider

  tab = {
    hl = tabby.hl:from('TabLine'),
    label = { '', tabby.tab.number, tabby.tab.name, tabby.tab.close_btn('x') },
    join = ' ',

Backwards compatibility

Hello,

Thanks for the Tabby plugin 🙏

I created a custom tabline in my config but it no longer works with v2.
I do plan on upgrading to v2 eventually but I saw the readme mentions:

Tabby thinks it's essential to stay backward compatible! So even if Tabby releases a brand new 2.0, it will not break the 1.0 configuration.

I thought I might be missing something simple so until I have the time to learn the new API and upgrade my code, is there an easy way to make my config work with the new version?
Or should I just lock the plugin to v1 until I update my tabline code?

Thanks?

Add buffer filter

Bufferline.nvim (docs) has filter option. Also it filter when you navigate between buffers (because of custom :BufferLineCycleNext command).
I know it's easy to make it. But I think it will really useful to make ready custom command and filter. I personally use it for nvim-dap (it create repl as buffer).

Window label provider

  win = {
    hl = tabby.hl:from('TabLine'),
    label = { '', tabby.win.name:unique() },
  • improve win's name API to support chain calling

Default tab style looks broken

The image shows the problem.

image

I'm using the nerd-fonts-jetbrains-mono font from the Arch User Repository, this same problem occurs in VTE based terminals, as well as in alacritty and konsole.

Using ttf-nerd-fonts-symbols from the Arch repos shows a similar problem with the glyphs:

image

Using other nerd font patched fonts like hack shows yet the same problem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.