docs: simplify extend/override example

This commit is contained in:
Michael Chris Lopez
2021-10-28 19:08:37 +08:00
parent fb181a3a36
commit 497dee22ed

View File

@@ -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()
-- 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
}
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