luatab.nvim
luatab.nvim copied to clipboard
How to replicate the look of the example in the readme?
I really like the way you made the example in the readme look, but I can't seem to replicate it. I took a look at your colors.vim
and plugins/config.lua
files, but I couldn't get it to look quite right. What should I do to make my tabline look like the example in the readme? My color scheme is navarasu/onedark.nvim
, if that makes a difference.
edit: Here is what I have right now:
Hey glad you like it!
The three hl groups you're concerned about are these (the use of exec
is to inject env vars):
exec('au ColorScheme gruvbox hi TabLine gui=none guibg=' . $color01 . ' guifg=' . $color03)
exec('au ColorScheme gruvbox hi TabLineSel guibg=' . $color01 . ' guifg=' . $color06)
exec('au ColorScheme gruvbox hi TabLineFill guibg=' . $color01)
In my case, I set the background of all 3 groups to be my actual bg color. Then for TabLine
(non-selected tabs) I dim the fg color, while for TabLineSel
I use my main fg color.
Oh, I just discovered what's not working. I was trying to use environment variables I don't have set.
Now I almost have it. The missing piece is how did you get your selected tab to be bold?
And one other thing: do you know if there is a way to read from the color values neovim currently has set? I have the color values from my theme entered into the fields, but if I were to change themes, the colors would be wrong.
au ColorScheme * hi TabLine gui=none guibg='#282C34' guifg='#5C6370' " all tabs color
au ColorScheme * hi TabLineSel guibg='#282C34' guifg='#B5BBC7' " Highlighted tab color
au ColorScheme * hi TabLineFill guibg='#282C34' " tabline portion without tabs (right-hand side)
Current state:
@PowerUser64 Thanks for posting this. I had the same desire and experimented with your post above. By inverting the values in guibg
and guifg
in the TabLineSel
autocommand, I get something similar to your original screenshot at the beginning of the thread:
vim.cmd([[au ColorScheme * hi TabLine gui=none guibg='#282C34' guifg='#5C6370']])
vim.cmd([[au ColorScheme * hi TabLineSel guibg='#B5BBC7' guifg='#282C34']])
vim.cmd([[au ColorScheme * hi TabLineFill guibg='#282C34' ]])
![image](https://user-images.githubusercontent.com/2037226/154823030-c83dd50f-f165-44d6-b912-3fc4f8ebc48f.png)
In regards to returning colors that are currently set on highlight elements, I think you can do something like this to get individual attribute values to later set color variables through a script like $color1
etc.:
:echo synIDattr(synIDtrans(hlInD("TabLineSel")), "fg#")
Also, thank you @alvarosevilla95 for making a simple and composable plugin. Awesome work!
I'm seeing the greenish(?) tab, and wanting to change it:
![image](https://user-images.githubusercontent.com/782512/158836474-e1d0821c-88a3-432e-a7f7-264be661901f.png)
But I'm a bit confused as to where and when to set the colours.