summaryrefslogtreecommitdiff
path: root/plugins/colorize
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2020-08-16 14:53:06 -0600
committerTuowen Zhao <ztuowen@gmail.com>2020-08-16 14:53:06 -0600
commitf672613e98ba6b30728517b22c0e378557d7fb81 (patch)
tree40f71cbf5809d181129f812e6466eac0b7cb2509 /plugins/colorize
parent1edd2c43b12f9f2c2ef04cfa0428db0f7fc0aa7c (diff)
parent079e7bb5e0a79171f3356d55d3f6302a82645a39 (diff)
downloadzsh-f672613e98ba6b30728517b22c0e378557d7fb81.tar.gz
zsh-f672613e98ba6b30728517b22c0e378557d7fb81.tar.bz2
zsh-f672613e98ba6b30728517b22c0e378557d7fb81.zip
Merge remote-tracking branch 'origin/master' into master
Diffstat (limited to 'plugins/colorize')
-rw-r--r--plugins/colorize/README.md8
-rw-r--r--plugins/colorize/colorize.plugin.zsh4
2 files changed, 10 insertions, 2 deletions
diff --git a/plugins/colorize/README.md b/plugins/colorize/README.md
index ee4ab8036..405bb6d39 100644
--- a/plugins/colorize/README.md
+++ b/plugins/colorize/README.md
@@ -38,6 +38,14 @@ Pygments offers multiple styles. By default, the `default` style is used, but yo
ZSH_COLORIZE_STYLE="colorful"
```
+### Chroma Formatter Settings
+
+Chroma supports terminal output in 8 color, 256 color, and true-color. If you need to change the default terminal output style from the standard 8 color output, set the `ZSH_COLORIZE_CHROMA_FORMATTER` environment variable:
+
+```
+ZSH_COLORIZE_CHROMA_FORMATTER=terminal256
+```
+
## Usage
* `ccat <file> [files]`: colorize the contents of the file (or files, if more than one are provided).
diff --git a/plugins/colorize/colorize.plugin.zsh b/plugins/colorize/colorize.plugin.zsh
index 6ed9739fa..80b69190f 100644
--- a/plugins/colorize/colorize.plugin.zsh
+++ b/plugins/colorize/colorize.plugin.zsh
@@ -46,7 +46,7 @@ colorize_cat() {
if [[ "$ZSH_COLORIZE_TOOL" == "pygmentize" ]]; then
pygmentize -O style="$ZSH_COLORIZE_STYLE" -g
else
- chroma --style="$ZSH_COLORIZE_STYLE"
+ chroma --style="$ZSH_COLORIZE_STYLE" --formatter="${ZSH_COLORIZE_CHROMA_FORMATTER:-terminal}"
fi
return $?
fi
@@ -62,7 +62,7 @@ colorize_cat() {
pygmentize -O style="$ZSH_COLORIZE_STYLE" -g "$FNAME"
fi
else
- chroma --style="$ZSH_COLORIZE_STYLE" "$FNAME"
+ chroma --style="$ZSH_COLORIZE_STYLE" --formatter="${ZSH_COLORIZE_CHROMA_FORMATTER:-terminal}" "$FNAME"
fi
done
}