diff options
author | AnakinXL <skywalkerrover@gmail.com> | 2019-03-28 18:31:17 -0700 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2019-03-29 10:31:17 +0900 |
commit | 82efe6c60d3884f0d79ce12375eda669d10d24b0 (patch) | |
tree | 17d491cc956c8f8d48c933f90a626d88640f2287 /README.md | |
parent | 75972d59a8c772028bd6c57bc1c18c993bf1967a (diff) |
[doc] Add bat for preview syntax highlighting example (#1538)
Similar to this PR from fzf.vim:
https://github.com/junegunn/fzf.vim/pull/712
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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' |