summaryrefslogtreecommitdiff
path: root/lua/tabby.lua
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2024-03-07 17:30:09 +0000
committerJosh Rahm <rahm@google.com>2024-03-07 17:30:09 +0000
commitafa6e0f99a082a7d9c01a88340aa027b9cc0e248 (patch)
tree984bd4bf09a030794d9a5ae6c0a8f9a4d1915a90 /lua/tabby.lua
parent4e2c14eb853ae25b66a9f12250f9856b8d954282 (diff)
downloadconfig.vim-afa6e0f99a082a7d9c01a88340aa027b9cc0e248.tar.gz
config.vim-afa6e0f99a082a7d9c01a88340aa027b9cc0e248.tar.bz2
config.vim-afa6e0f99a082a7d9c01a88340aa027b9cc0e248.zip
add tabby.lua
Diffstat (limited to 'lua/tabby.lua')
-rw-r--r--lua/tabby.lua48
1 files changed, 48 insertions, 0 deletions
diff --git a/lua/tabby.lua b/lua/tabby.lua
new file mode 100644
index 0000000..a189656
--- /dev/null
+++ b/lua/tabby.lua
@@ -0,0 +1,48 @@
+local theme = {
+ fill = 'TabLineFill',
+ -- Also you can do this: fill = { fg='#f2e9de', bg='#907aa9', style='italic' }
+ head = 'TabLine',
+ current_tab = 'TabLineSel',
+ tab = 'TabLine',
+ win = 'TabLine',
+ tail = 'TabLineTail',
+ close_sel = 'TabLineCloseSel',
+ close = 'TabLineClose',
+}
+require('tabby.tabline').set(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(),
+ tab.close_btn({' ', hl = tab.is_current() and theme.close_sel or theme.close}),
+ 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)