From 2bcdc46513fe1a60e86dbfeb02f1c8bad3901b8e Mon Sep 17 00:00:00 2001 From: Michael Chris Lopez Date: Sun, 10 Oct 2021 15:08:55 +0800 Subject: [PATCH] document how to extend/override some hl --- doc/zenbones.md | 31 ++++++++++++++++++++++++++++++- lua/neobones/init.lua | 1 - 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/doc/zenbones.md b/doc/zenbones.md index 8cbfbc9..0b2180e 100644 --- a/doc/zenbones.md +++ b/doc/zenbones.md @@ -81,6 +81,35 @@ print(theme.StatusLine.bg.hex) print(palette.blossom.darken(20).hex) ``` +Here's an example of how to extend/override some highlights: + +```lua +local function customize_zenbones() + if vim.g.colors_name ~= "zenbones" then + return + end + + local lush = require "lush" + local base = require "zenbones" + + local specs = lush.parse(function() + return { + TabLine { base.TabLine, gui = "italic" }, -- setting gui to "italic" + } + end) + + lush.apply(lush.compile(specs)) +end + +return customize_zenbones +``` + +And then somewhere in your config: + +```vim +autocmd VimEnter,ColorScheme * lua require("customize_zenbones")() +``` + See also [Lush's documentation](https://github.com/rktjmp/lush.nvim#advanced-usage) for more options. @@ -156,6 +185,6 @@ require("zenbones.term").apply_colors(palette) And there you have it. Just call `colorscheme gruvbones` to use your new colorscheme. It respects `&background` and other configurations too. -Also checkout the [neovim](../colors/neovim.lua) and +Also checkout the [neobones](../colors/neobones.lua) and [rosebones](../colors/rosebones.lua) colorscheme for a similar and complete example. diff --git a/lua/neobones/init.lua b/lua/neobones/init.lua index 79e01cf..5c022e6 100644 --- a/lua/neobones/init.lua +++ b/lua/neobones/init.lua @@ -5,7 +5,6 @@ local hsluv = lush.hsluv local base_name = util.bg_to_base_name() local p = require("neobones.palette")[base_name] --- extend specs using Lush if base_name == "zenbones" then local generator = require "zenbones.specs" local specs = generator.generate(p, generator.get_global_config())