repositories

NixDaemon

NixOS pentest workstation as one flake — IceBreaker's successor

clonegit clone https://git.daemon-sec.xyz/NixDaemon.git
highlighters.mdMarkdown132 lines4.6 KiBsource raw download

zsh-syntax-highlighting / highlighters#

Syntax highlighting is done by pluggable highlighters:

Highlighter-independent settings#

By default, all command lines are highlighted. However, it is possible to prevent command lines longer than a fixed number of characters from being highlighted by setting the variable ${ZSH_HIGHLIGHT_MAXLENGTH} to the maximum length (in characters) of command lines to be highlighter. This is useful when editing very long command lines (for example, with the fned utility function). Example:

ZSH_HIGHLIGHT_MAXLENGTH=512

How to activate highlighters#

To activate an highlighter, add it to the ZSH_HIGHLIGHT_HIGHLIGHTERS array. By default ZSH_HIGHLIGHT_HIGHLIGHTERS is (main). For example to activate brackets, pattern, and cursor highlighters, in ~/.zshrc do:

ZSH_HIGHLIGHT_HIGHLIGHTERS+=(brackets pattern cursor)

How to tweak highlighters#

Highlighters look up styles from the ZSH_HIGHLIGHT_STYLES associative array. Navigate into the individual highlighters' documentation to see what styles (keys) each highlighter defines; the syntax for values is the same as the syntax of "types of highlighting" of the zsh builtin $zle_highlight array, which is documented in the zshzle(1) manual page.

Some highlighters support additional configuration parameters; see each highlighter's documentation for details and examples.

How to implement a new highlighter#

To create your own acme highlighter: