Skip to content
Myr

[doc] Add bat for preview syntax highlighting example (#1538)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Similar to this PR from fzf.vim: https://github.com/junegunn/fzf.vim/pull/712

authored by AnakinXL · committed by Junegunn Choi · parent 75972d5 · Browse files · 1 file+4 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−2 removed

  • other:+4 added−2 removed

1 file+4 added−2 removed

modified:README.md+4 added-2 removed
496 unmodified lines
497498Preview window supports ANSI colors, so you can use programs that499syntax-highlights the content of a file.500501- Bat: https://github.com/sharkdp/bat502- Highlight: http://www.andre-simon.de/doku/highlight/en/highlight.php503- CodeRay: http://coderay.rubychan.de/504- Rouge: https://github.com/jneen/rouge505506```bash506# Try highlight, coderay, rougify in turn, then fall back to cat507# Try bat, highlight, coderay, rougify in turn, then fall back to cat508fzf --preview '[[ $(file --mime {}) =~ binary ]] &&509 echo {} is a binary file ||510 (bat --style=numbers --color=always {} ||509 (highlight -O ansi -l {} ||511 highlight -O ansi -l {} ||512 coderay {} ||513 rougify {} ||514 cat {}) 2> /dev/null | head -500'515```
104 unmodified lines