Browse Source

fv: look for bat to preview

develop
DanielFGray 1 year ago
parent
commit
f2713a9a44
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      fv

+ 3
- 1
fv View File

@@ -179,8 +179,10 @@ if [[ "$search_str" != '' ]]; then
fi

main() {
local highlight
highlight=$(select_from 'bat --color=always --style=header' 'highlight -q --force -O ansi')
choices=$($search_cmd "${search_opts[@]}" 2> /dev/null |
fzf --ansi --multi --preview='[[ $(file -b {}) = *text* ]] && highlight -q --force -O ansi {}') || exit 1
fzf --ansi --multi --preview="[[ \$(file -ib {}) = *text* ]] && ${highlight} {}") || exit 1

if [[ "$search_str" != '' ]]; then
if [[ $search_cmd == 'ag' ]]; then

Loading…
Cancel
Save