]> src.twobees.de Git - dotfiles.git/blob - stow/oh-my-zsh/.oh-my-zsh/plugins/colorize/README.md
initial
[dotfiles.git] / stow / oh-my-zsh / .oh-my-zsh / plugins / colorize / README.md
1 # colorize
2
3 With this plugin you can syntax-highlight file contents of over 300 supported languages and other text formats.
4
5 Colorize will highlight the content based on the filename extension. If it can't find a syntax-highlighting
6 method for a given extension, it will try to find one by looking at the file contents. If no highlight method
7 is found it will just cat the file normally, without syntax highlighting.
8
9 ## Setup
10
11 To use it, add colorize to the plugins array of your `~/.zshrc` file:
12 ```
13 plugins=(... colorize)
14 ```
15
16 ## Configuration
17
18 ### Requirements
19
20 This plugin requires that at least one of the following tools is installed:
21
22 * [Chroma](https://github.com/alecthomas/chroma)
23 * [Pygments](https://pygments.org/download/)
24
25 ### Colorize tool
26
27 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:
28
29 ```
30 ZSH_COLORIZE_TOOL=chroma
31 ```
32
33 ### Styles
34
35 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:
36
37 ```
38 ZSH_COLORIZE_STYLE="colorful"
39 ```
40
41 ### Chroma Formatter Settings
42
43 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:
44
45 ```
46 ZSH_COLORIZE_CHROMA_FORMATTER=terminal256
47 ```
48
49 ## Usage
50
51 * `ccat <file> [files]`: colorize the contents of the file (or files, if more than one are provided).
52   If no files are passed it will colorize the standard input.
53
54 * `cless [less-options] <file> [files]`: colorize the contents of the file (or files, if more than one are provided) and open less.
55   If no files are passed it will colorize the standard input.
56   The LESSOPEN and LESSCLOSE will be overwritten for this to work, but only in a local scope.