zenbones-theme / zenbones.nvim

🪨 A collection of contrast-based Vim/Neovim colorschemes
MIT License
689 stars 48 forks source link

Configurable TabLine italics styling #14

Closed synaptiko closed 2 years ago

synaptiko commented 2 years ago

Hello, thanks for the great scheme.

I've noticed you recently added Zenflesh variant and also the ability to enable/disable italics for comments.

Would you consider to do the same for TabLine? https://github.com/mcchrish/zenbones.nvim/blob/4cd223c9a27d8f73219c529eefc3c4d6f949edad/lua/zenbones/init.lua#L95

mcchrish commented 2 years ago

Make sense. For now, you can simply override the highlight with the help of lush.

colorscheme zenflesh

lua << EOF
local lush = require "lush"
local base = require "zenflesh"

local specs = lush.parse(function()
    return {
        TabLine { bg = base.TabLine.bg, fg = base.TabLine.fg, gui = nil }, -- setting gui to nil, not "italic"
    }
end)

lush.apply(lush.compile(specs))

EOF

The snippet just creates a small lush specs then applies it. This is more flexible and allows you to add more overrides if you want.

It's actually just simply:

TabLine { base.TabLine, gui = nil },

But not sure why it's not being accepted by lush.

synaptiko commented 2 years ago

Thank you for the snippet, I didn't realize it's that simple :+1:

mcchrish commented 2 years ago

As a follow up, there is a better way to apply overrides and I'll probably document it as the recommended way.

lua/customize_zenbones.lua:

local function customize_zenbones()
    local colors_name = vim.g.colors_name
    if colors_name ~= "zenbones" and colors_name ~= "zenbones-lush" then
        return
    end

    local lush = require "lush"
    local base = require "zenbones"

    local specs = lush.parse(function()
        return {
            TabLine { base.TabLine, gui = "NONE" }, -- setting gui to "NONE", not "italic"
        }
    end)

    lush.apply(lush.compile(specs))
end

return customize_zenbones

Somewhere in your config:

autocmd VimEnter,ColorScheme * lua require("customize_zenbones")()