diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2020-01-02 15:46:19 -0500 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2020-01-02 15:46:19 -0500 |
commit | ff9208623b3573c736ae9118947aaf0c7e752998 (patch) | |
tree | 45977b00446155003d486c04c3b891a5b7c88441 /plugins/colorize/README.md | |
parent | 1456610ebd292625fdc34fa3167c9c0f67d85228 (diff) | |
parent | ca627655dbd1d110dbea34ec4a8c1964a1da83d2 (diff) | |
download | zsh-ff9208623b3573c736ae9118947aaf0c7e752998.tar.gz zsh-ff9208623b3573c736ae9118947aaf0c7e752998.tar.bz2 zsh-ff9208623b3573c736ae9118947aaf0c7e752998.zip |
Merge branch 'master' of https://github.com/ohmyzsh/ohmyzsh
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 32dc97b6e..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.html) +* `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. |