Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable TabLine italics styling #14

Closed
synaptiko opened this issue Oct 5, 2021 · 3 comments
Closed

Configurable TabLine italics styling #14

synaptiko opened this issue Oct 5, 2021 · 3 comments

Comments

@synaptiko
Copy link

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
Copy link
Collaborator

mcchrish commented Oct 5, 2021

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
Copy link
Author

Thank you for the snippet, I didn't realize it's that simple 👍

@mcchrish
Copy link
Collaborator

mcchrish commented Oct 6, 2021

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")()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants