From 497dee22ed77a333b6139c40a1fc059dd8f05649 Mon Sep 17 00:00:00 2001 From: Michael Chris Lopez Date: Thu, 28 Oct 2021 19:08:37 +0800 Subject: [PATCH] docs: simplify extend/override example --- doc/zenbones.md | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/doc/zenbones.md b/doc/zenbones.md index 0b01d4d..9be734f 100644 --- a/doc/zenbones.md +++ b/doc/zenbones.md @@ -110,31 +110,23 @@ Here's an example of how to extend/override some highlights. `lua/customize_zenbones.lua`: ```lua -local function customize_zenbones() - if vim.g.colors_name ~= "zenbones" then - return - end +local lush = require "lush" +local base = require "zenbones" - local lush = require "lush" - local base = require "zenbones" - - -- Create some specs - local specs = lush.parse(function() - return { - TabLine { base.TabLine, gui = "italic" }, -- setting gui to "italic" - - end) - -- Apply specs using lush tool-chain - lush.apply(lush.compile(specs)) -end - -return customize_zenbones +-- Create some specs +local specs = lush.parse(function() + return { + TabLine { base.TabLine, gui = "italic" }, -- setting gui to "italic" + } +end) +-- Apply specs using lush tool-chain +lush.apply(lush.compile(specs)) ``` And then somewhere in your `init.vim`: ```vim -autocmd VimEnter,ColorScheme * lua require("customize_zenbones")() +autocmd ColorScheme zenbones lua require "customize_zenbones" ``` See also