|
|
|
|
|
by bomewish
631 days ago
|
|
I also have a custom rga-fzf function, I think adapted from that: rga-fzf () {
local query=$1
local extension=$2
if [ -z "$extension" ]
then
RG_PREFIX="rga --files-with-matches --no-ignore"
else
RG_PREFIX="rga --files-with-matches --no-ignore --glob '*.$extension'"
fi
echo "RG Prefix: $RG_PREFIX"
echo "Search Query: $query"
FZF_DEFAULT_COMMAND="$RG_PREFIX '$query'" fzf --sort --preview="[[ ! -z {} ]] && rga --colors 'match:bg:yellow' --pretty --context 15 {q} {} | less -R" --multi --phony -q "$query" --color "hl:-1:underline,hl+:-1:underline:reverse" --bind "change:reload:$RG_PREFIX {q}" --preview-window="50%:wrap" --bind "enter:execute-silent(echo {} | xargs -n 1 open -g)"
} It allows one to continually open lots of files found through rga-fzf, so one can look at them in $EDITOR all at once. Useful sometimes. |
|