summaryrefslogtreecommitdiff
path: root/pkgs/old-custom-neovim/config/lua/plugins/tabby.lua
blob: c00dad7d6251f8af04e3740c34e90e876c2831b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
local general_theme = Utils.generate_theme_from_highlight_groups()
local colors = {
  current = { fg = general_theme.modes.normal, bg = general_theme.background, style = 'bold'},
  not_current = { fg = general_theme.text.light, bg = general_theme.background };
  fill = { bg = general_theme.background };
};
local theme = {
  fill = colors.fill,
  head = colors.fill,
  current_tab = colors.current,
  tab = colors.not_current,
  win = colors.fill,
  tail = colors.fill,
}
require('tabby').setup({
  line = function(line)
    return {
      {
        -- { '  ', hl = theme.head },
        -- line.sep('', theme.head, theme.fill),
      },
      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(),
          line.sep('', hl, theme.fill),
          hl = hl,
          margin = ' ',
        }
      end),
      line.spacer(),
      line.wins_in_tab(line.api.get_current_tab()).foreach(function(win)
        return {
          line.sep('', theme.win, theme.fill),
          -- win.is_current() and '' or '',
          win.buf_name(),
          line.sep('', theme.win, theme.fill),
          hl = theme.win,
          margin = ' ',
        }
      end),
      {
        line.sep('', theme.tail, theme.fill),
        -- { '  ', hl = theme.tail },
      },
      hl = theme.fill,
    }
  end,
  -- option = {}, -- setup modules' option,
})