mirror of
https://github.com/FliegendeWurst/ripgrep-all.git
synced 2024-11-24 12:24:56 +00:00
move fzf info to wiki
This commit is contained in:
parent
1072fbf251
commit
e4fb99b99d
43
README.md
43
README.md
@ -33,46 +33,7 @@ demo/
|
|||||||
|
|
||||||
![rga-fzf](doc/rga-fzf.gif)
|
![rga-fzf](doc/rga-fzf.gif)
|
||||||
|
|
||||||
You can use rga interactively via fzf. Add the following to your ~/.{bash,zsh}rc:
|
See [the wiki](https://github.com/phiresky/ripgrep-all/wiki/fzf-Integration) for instructions of integrating rga with fzf.
|
||||||
|
|
||||||
```bash
|
|
||||||
rga-fzf() {
|
|
||||||
RG_PREFIX="rga --files-with-matches"
|
|
||||||
local file
|
|
||||||
file="$(
|
|
||||||
FZF_DEFAULT_COMMAND="$RG_PREFIX '$1'" \
|
|
||||||
fzf --sort --preview="[[ ! -z {} ]] && rga --pretty --context 5 {q} {}" \
|
|
||||||
--phony -q "$1" \
|
|
||||||
--bind "change:reload:$RG_PREFIX {q}" \
|
|
||||||
--preview-window="70%:wrap"
|
|
||||||
)" &&
|
|
||||||
echo "opening $file" &&
|
|
||||||
xdg-open "$file"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
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
|
## INSTALLATION
|
||||||
|
|
||||||
@ -120,7 +81,7 @@ If you get an error like `VCRUNTIME140.DLL could not be found`, you need to inst
|
|||||||
|
|
||||||
To install the dependencies that are each not strictly necessary but very useful:
|
To install the dependencies that are each not strictly necessary but very useful:
|
||||||
|
|
||||||
`brew install pandoc poppler tesseract ffmpeg`
|
`brew install pandoc poppler ffmpeg`
|
||||||
|
|
||||||
### Compile from source
|
### Compile from source
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user