*zenbones.txt* A collection of contrast-based vim/neovim colorschemes ============================================================================== Table of Contents *zenbones-table-of-contents* 1. Zenbones |zenbones-zenbones| - Usage |zenbones-usage| - Configuration |zenbones-configuration| - Advanced Usage |zenbones-advanced-usage| ============================================================================== 1. Zenbones *zenbones-zenbones* Zenbones is a collection of vim/neovim colorschemes designed to highlight code using contrasts and font variations. Colors are tasked only for other roles such as diagnostics, diffs, search matches. USAGE *zenbones-usage* Just apply the colorscheme as usual: > set termguicolors colorscheme zenbones " light colorscheme zenflesh " dark colorscheme zenwritten " Zero hue and saturation version colorscheme neobones " https://neovim.io flavor colorscheme rosebones " Rosé Pine flavor - https://rosepinetheme.com colorscheme forestbones " Everforest flavor - https://github.com/sainnhe/everforest colorscheme nordbones " Nord flavor - https://www.nordtheme.com/docs/colors-and-palettes colorscheme tokyobones " Tokyo Night flavor - https://github.com/enkia/tokyo-night-vscode-theme#color-palette < It works pretty much the same as the first one but pretty handy when extending or customizing the colors to your likings. CONFIGURATION *zenbones-configuration* Configuration is only available for neovim. There are two ways to set configuration. First: > " vimscript let g:zenbones_solid_line_nr = v:true let g:zenbones_darken_comments = 45 < > -- lua vim.g.zenbones_solid_line_nr = true vim.g.zenbones_darken_comments = 45 < Second way is to set configuration is to assign a dictionary to the prefix: > " vimscript let g:forestbones = #{ solid_line_nr: v:true, darken_comments: 45 } < > -- lua vim.g.forestbones = { solid_line_nr = true, darken_comments = 45 } < **Notes**: Flavors accept their own configuration by replacing the prefix with the flavor name e.g. `g:rosebones_italic_comments`. │ Option │Backg│Defau│ Description │ │ │round│ lt │ │ │ │ │ │ │ │lightness │light│nil │Change background colors lightness. Options: 'bri│ │ │ │ │ght', 'dim'. │ │darkness │dark │nil │Change background colors darkness. Options: 'star│ │ │ │ │k', 'warm'. │ │solid_vert_spl│both │false│Solid |hl-VertSplit| background. │ │it │ │ │ │ │solid_line_nr │both │false│Solid |hl-LineNr| background. │ │ │ │ │ │ │solid_float_bo│both │false│Make |hl-FloatBorder| have a more distinguishable│ │rder │ │ │ background highlight. │ │darken_noncurr│light│false│Make non-current window background darker than _N│ │ent_window │ │ │ormal_. │ │lighten_noncur│dark │false│Make non-current window background lighter than _│ │rent_window │ │ │Normal_. │ │italic_comment│both │true │Make comments italicize. │ │s │ │ │ │ │darken_comment│light│38 │Percentage to darken comments relative to Normal │ │s │ │ │bg. See also |lush-color-darken|. │ │lighten_commen│dark │38 │Percentage to lighten comments relative to Normal│ │ts │ │ │ bg. See also |lush-color-lighten|. │ │darken_non_tex│light│25 │Percentage to darken |hl-NonText| relative to Nor│ │t │ │ │mal bg. See also |lush-color-darken|. │ │lighten_non_te│dark │30 │Percentage to lighten |hl-NonText| relative to No│ │xt │ │ │rmal bg. See also |lush-color-darken|. │ │darken_line_nr│light│33 │Percentage to darken |hl-LineNr| relative to Norm│ │ │ │ │al bg. See also |lush-color-darken|. │ │lighten_line_n│dark │35 │Percentage to lighten |hl-LineNr| relative to Nor│ │r │ │ │mal bg. See also |lush-color-darken|. │ *zenbones-g:zenbones_compat* g:zenbones_compat Set to `1` to turn on compatibility mode. Turned on in vim. *zenbones-lightline* > let g:lightline = { \ 'colorscheme': 'zenbones', " or 'zenflesh' \ } < *zenbones-lualine* > options = { theme = 'zenbones' } -- or 'zenflesh' < ADVANCED USAGE *zenbones-advanced-usage* Zenbones is pretty extensible thanks to Lush. You can easily retrieve the colors in lua: > local theme = require "zenbones" -- or zenflesh local palette = require "zenbones.palette" print(theme.StatusLine.bg.hex) print(palette.blossom.darken(20).hex) < Here’s an example of how to extend/override some highlights. `lua/customize_zenbones.lua`: > local function customize_zenbones() if vim.g.colors_name ~= "zenbones" then return end 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 < And then somewhere in your `init.vim`: > autocmd VimEnter,ColorScheme * lua require("customize_zenbones")() < See also Lush’s documentation for more options. CREATE YOUR OWN COLORSCHEME ~ You can ultimately create your own colorscheme that is based on zenbones by defining a palette and generating a specs. Best way to demonstrate this is through an example. Let’s make a zenbones-flavored Gruvbox colorscheme called `gruvbones`. Let’s define our |colorscheme| in `colors/gruvbones.lua`. It contains the following: > local colors_name = "gruvbones" vim.g.colors_name = colors_name -- Required when defining a colorscheme local lush = require "lush" local hsluv = lush.hsluv -- Human-friendly hsl local util = require "zenbones.util" local bg = vim.opt.background:get() -- Define a palette. Use `palette_extend` to fill unspecified colors -- Based on https://github.com/gruvbox-community/gruvbox#palette local palette if bg == "light" then palette = util.palette_extend({ bg = hsluv "#fbf1c7", fg = hsluv "#3c3836", rose = hsluv "#9d0006", leaf = hsluv "#79740e", wood = hsluv "#b57614", water = hsluv "#076678", blossom = hsluv "#8f3f71", sky = hsluv "#427b58", }, bg) else palette = util.palette_extend({ bg = hsluv "#282828", fg = hsluv "#ebdbb2", rose = hsluv "#fb4934", leaf = hsluv "#b8bb26", wood = hsluv "#fabd2f", water = hsluv "#83a598", blossom = hsluv "#d3869b", sky = hsluv "#83c07c", }, bg) end -- Generate the lush specs using the generator util local generator = require "zenbones.specs" local base_specs = generator.generate(palette, bg, generator.get_global_config(colors_name, bg)) -- Optionally extend specs using Lush local specs = lush.extends({ base_specs }).with(function() return { Statement { base_specs.Statement, fg = palette.rose }, Special { fg = palette.water }, Type { fg = palette.sky, gui = "italic" }, } end) -- Pass the specs to lush to apply lush(specs) -- Optionally set term colors 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 neobones <../colors/neobones.lua> and rosebones <../colors/rosebones.lua> colorscheme for a similar and complete example. Generated by panvimdoc vim:tw=78:ts=8:noet:ft=help:norl: