Skip to content

v1.5.0 – APIs

Compare
Choose a tag to compare
@Iron-E Iron-E released this 13 Nov 22:29
· 224 commits to master since this release

Introduction

While playing around with some other plugins, I wondered what I would be like if I could adjust my colorscheme on the fly using the simplistic highlighting syntax featured in this plugin. As a result, now you can!

local highlite = require('highlite')

local yellow = {'#f0df33', 220, 'yellow'}

-- Highlight a new group
highlite.highlight('Todo', {fg=yellow, style={'bold', 'underline'}})

-- Link a group
highlite.highlight('Identifier', 'Todo')

You can call this function from anywhere, as seen here in my Galaxyline config. It allows the :highlight command to be entirely bypassed with a much simpler version.

  • This also means that nvim-highlite can be referenced as a dependency, rather than used as a template.
  • While I still recommend its use as a template, using the highlight() function may be useful in initializing personal configuration settings.

Changes

  • Added docs (see :help highlite in Neovim)
  • Exposed highlite.highlight().
  • Exposed highlite.highlight_terminal().
  • Added highlite.__call() to maintain compatability with previous versions.
    • Calling the highlite module allows you to perform a complete reset of all highlight groups, like is done here in the template.
  • Improve startup time ~2ms.