Skip to content

(Neo)vim perceptual color scheme compiler

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

tomcur/hi-nvim-rs

Repository files navigation

hi.nvim.rs

(Neo)vim perceptual color scheme compiler

MIT Apache 2.0 Crates.io Docs

Create (Neo)vim color schemes by defining colors and their transformations. This uses the Oklab color space to make the perceptual effects of transformations predictable.

A hosted version is available here.

Feature summary

  • Color schemes are compiled to (Neo)vim configurations with no startup overhead
  • Specify colors using lightness, chromacity and hue in the Oklch color space
  • If you're creating a dark theme, you get the inverse light theme for free, and vice versa
  • A curated set of opinionated default Neovim highlight groups is provided, requiring only a few theme definitions to get a consistent color scheme
  • Theme colors definitions refer to colors with optional transformations (such as lightness and chromacity)
  • Override or add any highlight group
  • Vim is supported as a secondary target

Examples

Normal Inverse
A screenshot of Neovim using the "highlow" light color scheme A screenshot of Neovim using the "highlow" dark color scheme

highlow: a color scheme with high contrast between background and foreground, low color saturation, and low contrast between foreground elements.

Normal Inverse
A screenshot of Neovim using the "twocolor" dark color scheme A screenshot of Neovim using the "twocolor" light color scheme

twocolor: a color scheme using (mostly) just two hues.

Getting started

To run the CLI version, run

$ cargo install hi-nvim-rs
$ hi-nvim-rs --help
$ hi-nvim-rs ./path/to/colorscheme.toml > ~/.config/nvim/colors/a-colorscheme-name.vim