feat: add --highlight and --limit options

closes #4
This commit is contained in:
CJ van den Berg 2024-03-12 17:24:55 +01:00
parent f511eb4434
commit 35c1578246
3 changed files with 142 additions and 30 deletions

18
scripts/fzf-grep Executable file
View file

@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -eEuCo pipefail
rg \
--no-heading \
--color always \
-n \
"$@" \
| fzf \
--marker=\* \
--delimiter=: \
--border \
--cycle \
--layout=reverse \
--ansi \
--tiebreak=index \
--preview 'zat --highlight {2} --limit $FZF_PREVIEW_LINES {1}'