Skip to content
/ Chroma Public

Simple extensible markup based colour message (:echo) printer for Vim

Notifications You must be signed in to change notification settings

dahu/Chroma

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Chroma

Simple extensible markup based colour message (:echo) printer

Chroma is an extensible, markup based colour (:echo) printer for Vim. It uses a simple tag markup similar to common lightweight text markup tools, like markdown, asciidoc and restructured text.

Chroma provides three mechanisms to generate coloured printing:

  1. a g:chroma object with a print(msg) method

  2. a :Chroma command that accesses the g:chroma object

  3. a Chroma() object factory for generating custom chroma objects

The set of built-in tags and their corresponding highlight-groups are:

  • ! text ! — Error

  • * text * — WarningMsg

  • + text + — Type

  • / text / — Keyword

  • _ text _ — Label

The public API of the Chroma class is:

  • print(msg) — Command to colour print the given marked-up msg

    call chroma.print("!Error!: You /can't/ do _that_ on +television+!")
  • add(tag, highlight) — Allow text marked up as <tag>text<tag> to be highlighted with the given group

    call chroma.add('@', 'ModeMsg')
    call chroma.print("!Error!: @You@ /can't/ do _that_ on +television+!")
  • del(tag) — Prevent text marked up as <tag>text<tag> from being coloured

    call chroma.del('@')
    call chroma.print("!Error!: @You@ /can't/ do *that* on +television+!")

    Now prints: @You@ instead of 'You' in colour.

  • set(tag, highlight) — An alias for add(tag, highlight)

About

Simple extensible markup based colour message (:echo) printer for Vim

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published