mirror of
https://github.com/FliegendeWurst/ripgrep-all.git
synced 2024-11-10 06:50:38 +00:00
Add rga-fzf function for fish
This commit is contained in:
parent
2cd049081d
commit
b7e7054294
22
README.md
22
README.md
@ -51,6 +51,28 @@ rga-fzf() {
|
||||
}
|
||||
```
|
||||
|
||||
And for your `~/.config/fish/config.fish`:
|
||||
```
|
||||
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
|
||||
```
|
||||
|
||||
## INSTALLATION
|
||||
|
||||
Linux x64, macOS and Windows binaries are available [in GitHub Releases][latestrelease].
|
||||
|
Loading…
Reference in New Issue
Block a user