my xfce4 dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
2.0 KiB

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