diff options
author | Marc Cornellà <marc.cornella@live.com> | 2020-02-27 22:55:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-27 22:55:30 +0100 |
commit | 18ee5dffdc57bb9219ee96b40da006704ac37df1 (patch) | |
tree | e1fe420cf18fa7a916d5d43c408c6f92ed33b62d /plugins/colorize/README.md | |
parent | d81cd753e0b3a845e8f3549da245dbad102a6e4c (diff) | |
parent | 368198b7616eb69b396de86d9ec4ff0f35bd72f0 (diff) | |
download | zsh-18ee5dffdc57bb9219ee96b40da006704ac37df1.tar.gz zsh-18ee5dffdc57bb9219ee96b40da006704ac37df1.tar.bz2 zsh-18ee5dffdc57bb9219ee96b40da006704ac37df1.zip |
Merge branch 'master' into clipboard
Diffstat (limited to 'plugins/colorize/README.md')
-rw-r--r-- | plugins/colorize/README.md | 43 |
1 files changed, 28 insertions, 15 deletions
diff --git a/plugins/colorize/README.md b/plugins/colorize/README.md index d1f878e62..ee4ab8036 100644 --- a/plugins/colorize/README.md +++ b/plugins/colorize/README.md @@ -6,30 +6,43 @@ Colorize will highlight the content based on the filename extension. If it can't method for a given extension, it will try to find one by looking at the file contents. If no highlight method is found it will just cat the file normally, without syntax highlighting. -To use it, add colorize to the plugins array of your zshrc file: +## Setup + +To use it, add colorize to the plugins array of your `~/.zshrc` file: ``` plugins=(... colorize) ``` -## Styles +## Configuration -Pygments offers multiple styles. By default, the `default` style is used, but you can choose another theme by setting the `ZSH_COLORIZE_STYLE` environment variable: +### Requirements -`ZSH_COLORIZE_STYLE="colorful"` +This plugin requires that at least one of the following tools is installed: -## Usage +* [Chroma](https://github.com/alecthomas/chroma) +* [Pygments](https://pygments.org/download/) + +### Colorize tool -* `ccat <file> [files]`: colorize the contents of the file (or files, if more than one are provided). - If no arguments are passed it will colorize the standard input or stdin. +Colorize supports `pygmentize` and `chroma` as syntax highlighter. By default colorize uses `pygmentize` unless it's not installed and `chroma` is. This can be overridden by the `ZSH_COLORIZE_TOOL` environment variable: + +``` +ZSH_COLORIZE_TOOL=chroma +``` -* `cless <file> [files]`: colorize the contents of the file (or files, if more than one are provided) and - open less. If no arguments are passed it will colorize the standard input or stdin. +### Styles -Note that `cless` will behave as less when provided more than one file: you have to navigate files with -the commands `:n` for next and `:p` for previous. The downside is that less options are not supported. -But you can circumvent this by either using the LESS environment variable, or by running `ccat file1 file2|less --opts`. -In the latter form, the file contents will be concatenated and presented by less as a single file. +Pygments offers multiple styles. By default, the `default` style is used, but you can choose another theme by setting the `ZSH_COLORIZE_STYLE` environment variable: + +``` +ZSH_COLORIZE_STYLE="colorful" +``` + +## Usage -## Requirements +* `ccat <file> [files]`: colorize the contents of the file (or files, if more than one are provided). + If no files are passed it will colorize the standard input. -You have to install Pygments first: [pygments.org](http://pygments.org/download/) +* `cless [less-options] <file> [files]`: colorize the contents of the file (or files, if more than one are provided) and open less. + If no files are passed it will colorize the standard input. + The LESSOPEN and LESSCLOSE will be overwritten for this to work, but only in a local scope. |