Module colorizer

Colorizer

See also:

Functions

attach_to_buffer (bufnr, opts, bo_type) Attach to a buffer and continuously highlight changes.
clear_highlight_cache () Clears the highlight cache and reloads all buffers.
detach_from_buffer (bufnr) Stop highlighting the current buffer.
get_attached_bufnr (bufnr) Get attached bufnr
highlight_buffer () Highlight the buffer region.
is_buffer_attached (bufnr) Check if buffer is attached to colorizer
rehighlight (bufnr, opts, buf_local_opts, hl_opts) Rehighlight the buffer if colorizer is active
reload_all_buffers () Reload all of the currently active highlighted buffers.
reload_on_save (pattern) Reload file on save; used for dev, to edit expect.txt and apply highlights from returned setup table
setup (opts) Easy to use function if you want the full setup without fine grained control.


Functions

attach_to_buffer (bufnr, opts, bo_type)
Attach to a buffer and continuously highlight changes.
clear_highlight_cache ()
Clears the highlight cache and reloads all buffers.
detach_from_buffer (bufnr)
Stop highlighting the current buffer.
get_attached_bufnr (bufnr)
Get attached bufnr

See also:

highlight_buffer ()
Highlight the buffer region.

See also:

is_buffer_attached (bufnr)
Check if buffer is attached to colorizer
rehighlight (bufnr, opts, buf_local_opts, hl_opts)
Rehighlight the buffer if colorizer is active - ns_id number: Table of namespace ids to clear - functions function: Table of detach functions to call
reload_all_buffers ()
Reload all of the currently active highlighted buffers.
reload_on_save (pattern)
Reload file on save; used for dev, to edit expect.txt and apply highlights from returned setup table
setup (opts)
Easy to use function if you want the full setup without fine grained control. Setup an autocmd which enables colorizing for the filetypes and options specified.

By default highlights all FileTypes.

Example config:~

  { filetypes = { "css", "html" }, user_default_options = { names = true } }

Setup with all the default options:~

    require("colorizer").setup {
      user_commands,
      filetypes = { "*" },
      user_default_options,
      -- all the sub-options of filetypes apply to buftypes
      buftypes = {},
    }

Setup colorizer with user options

See also:

generated by LDoc 1.5.0 Last updated 2026-03-24 02:29:38