mirror of
https://github.com/FliegendeWurst/ripgrep-all.git
synced 2024-11-24 12:24:56 +00:00
fix "no such file" in rga-fzf
This commit is contained in:
parent
c295c040cc
commit
38185dda21
@ -31,15 +31,15 @@ demo/
|
|||||||
|
|
||||||
![rga-fzf](doc/rga-fzf.gif)
|
![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
|
```bash
|
||||||
rga-fzf() {
|
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
|
local file
|
||||||
file="$(
|
file="$(
|
||||||
FZF_DEFAULT_COMMAND="$RG_PREFIX '$1'" \
|
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" \
|
--phony -q "$1" \
|
||||||
--bind "change:reload:$RG_PREFIX {q}" \
|
--bind "change:reload:$RG_PREFIX {q}" \
|
||||||
--preview-window="70%:wrap"
|
--preview-window="70%:wrap"
|
||||||
|
Loading…
Reference in New Issue
Block a user