From 82efe6c60d3884f0d79ce12375eda669d10d24b0 Mon Sep 17 00:00:00 2001 From: AnakinXL Date: Thu, 28 Mar 2019 18:31:17 -0700 Subject: [PATCH] [doc] Add bat for preview syntax highlighting example (#1538) Similar to this PR from fzf.vim: https://github.com/junegunn/fzf.vim/pull/712 --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 30bcb861..6a595aa9 100644 --- a/README.md +++ b/README.md @@ -498,15 +498,17 @@ fzf --preview 'head -100 {}' Preview window supports ANSI colors, so you can use programs that syntax-highlights the content of a file. +- Bat: https://github.com/sharkdp/bat - Highlight: http://www.andre-simon.de/doku/highlight/en/highlight.php - CodeRay: http://coderay.rubychan.de/ - Rouge: https://github.com/jneen/rouge ```bash -# Try highlight, coderay, rougify in turn, then fall back to cat +# Try bat, highlight, coderay, rougify in turn, then fall back to cat fzf --preview '[[ $(file --mime {}) =~ binary ]] && echo {} is a binary file || - (highlight -O ansi -l {} || + (bat --style=numbers --color=always {} || + highlight -O ansi -l {} || coderay {} || rougify {} || cat {}) 2> /dev/null | head -500'