fix "no such file" in rga-fzf

This commit is contained in:
phiresky 2020-06-07 23:50:59 +02:00
parent c295c040cc
commit 38185dda21

View File

@ -31,15 +31,15 @@ demo/
![rga-fzf](doc/rga-fzf.gif)
You can use rga interactively. Add the following to your ~/.{bash,zsh}rc:
You can use rga interactively via fzf. Add the following to your ~/.{bash,zsh}rc:
```bash
rga-fzf() {
RG_PREFIX="rga --files-with-matches --rga-cache-max-blob-len=10M $RGA_ARGS"
RG_PREFIX="rga --files-with-matches --rga-cache-max-blob-len=10M"
local file
file="$(
FZF_DEFAULT_COMMAND="$RG_PREFIX '$1'" \
fzf --sort --preview="rga --pretty --context 5 {q} {}" \
fzf --sort --preview="[[ ! -z {} ]] && rga --pretty --context 5 {q} {}" \
--phony -q "$1" \
--bind "change:reload:$RG_PREFIX {q}" \
--preview-window="70%:wrap"