mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-12-26 12:27:58 +00:00
[doc] Add bat for preview syntax highlighting example (#1538)
Similar to this PR from fzf.vim: https://github.com/junegunn/fzf.vim/pull/712
This commit is contained in:
parent
75972d59a8
commit
82efe6c60d
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user