parent
ed9fafdc76
commit
c9026eb842
1 changed files with 19 additions and 0 deletions
|
@ -24,6 +24,25 @@ if status is-interactive
|
|||
|
||||
# opam
|
||||
#source ~/.opam/opam-init/init.fish > /dev/null 2> /dev/null; or true
|
||||
|
||||
function rga-fzf
|
||||
set RG_PREFIX 'rga --files-with-matches'
|
||||
if test (count $argv) -gt 1
|
||||
set RG_PREFIX "$RG_PREFIX $argv[1..-2]"
|
||||
end
|
||||
set -l file $file
|
||||
set file (
|
||||
FZF_DEFAULT_COMMAND="$RG_PREFIX '$argv[-1]'" \
|
||||
fzf --sort \
|
||||
--preview='test ! -z {} && \
|
||||
rga --pretty --context 5 {q} {}' \
|
||||
--phony -q "$argv[-1]" \
|
||||
--bind "change:reload:$RG_PREFIX {q}" \
|
||||
--preview-window='50%:wrap'
|
||||
) && \
|
||||
echo "opening $file" && \
|
||||
open "$file"
|
||||
end
|
||||
end
|
||||
|
||||
# starship
|
||||
|
|
Loading…
Reference in a new issue