Module colorizer

Highlights terminal CSI ANSI color codes.

Functions

highlight_buffer (buf[, ns=DEFAULT_NAMESPACE], lines, line_start[, options]) Highlight the buffer region.
attach_to_buffer ([buf=0[, options]]) Attach to a buffer and continuously highlight changes.
setup ([filetypes={'*'}[, default_options]]) Easy to use function if you want the full setup without fine grained control.

Fields

DEFAULT_NAMESPACE Default namespace used in `highlight_buffer` and `attach_to_buffer`.


Functions

highlight_buffer (buf[, ns=DEFAULT_NAMESPACE], lines, line_start[, options])
Highlight the buffer region. Highlight starting from `line_start` (0-indexed) for each line described by `lines` in the buffer `buf` and attach it to the namespace `ns`.

Parameters:

  • buf integer buffer id.
  • ns integer the namespace id. Create it with `vim.api.create_namespace` (default DEFAULT_NAMESPACE)
  • lines {string,...} the lines to highlight from the buffer.
  • line_start integer should be 0-indexed
  • options Configuration options as described in `setup` (optional)

See also:

attach_to_buffer ([buf=0[, options]])
Attach to a buffer and continuously highlight changes.

Parameters:

  • buf integer A value of 0 implies the current buffer. (default 0)
  • options Configuration options as described in `setup` (optional)

See also:

setup ([filetypes={'*'}[, default_options]])
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: ``` { 'scss', 'html', css = { rgb_fn = true; }, javascript = { no_names = true } } ```

You can combine an array and more specific options. Possible options: - `no_names`: Don't highlight names like Blue - `rgb_fn`: Highlight `rgb(...)` functions. - `mode`: Highlight mode. Valid options: `foreground`,`background`

Parameters:

  • filetypes A table/array of filetypes to selectively enable and/or customize. By default, enables all filetypes. (default {'*'})
  • default_options {[string]=string} Default options to apply for the filetypes enable. (optional)

Usage:

    require'colorizer'.setup()

Fields

DEFAULT_NAMESPACE
Default namespace used in `highlight_buffer` and `attach_to_buffer`. The name is "terminal_highlight"

See also:

generated by LDoc 1.4.6 Last updated 2019-10-17 16:25:49