add fzf gif

This commit is contained in:
phiresky 2020-06-06 15:24:01 +02:00
parent 501da361ee
commit 2ef2babbff
3 changed files with 26 additions and 8 deletions

View File

@ -27,6 +27,28 @@ demo/
![rga output](doc/demodir.png) ![rga output](doc/demodir.png)
## Integration with fzf
![rga-fzf](doc/rga-fzf.gif)
You can use rga interactively. Add the following to your ~/.{bash,zsh}rc:
```bash
rga-fzf() {
RG_PREFIX="rga --files-with-matches --rga-cache-max-blob-len=10M $RGA_ARGS"
local file
file="$(
FZF_DEFAULT_COMMAND="$RG_PREFIX '$1'" \
fzf --sort --preview="rga --pretty --context 5 {q} {}" \
--phony -q "$1" \
--bind "change:reload:$RG_PREFIX {q}" \
--preview-window=wrap
)" &&
echo "opening $file" &&
xdg-open "$file"
}
```
## INSTALLATION ## INSTALLATION
Linux x64, macOS and Windows binaries are available [in GitHub Releases][latestrelease]. Linux x64, macOS and Windows binaries are available [in GitHub Releases][latestrelease].
@ -89,12 +111,10 @@ Adapters:
Uses ffmpeg to extract video metadata/chapters and subtitles Uses ffmpeg to extract video metadata/chapters and subtitles
Extensions: .mkv, .mp4, .avi Extensions: .mkv, .mp4, .avi
* **pandoc** * **pandoc**
Uses pandoc to convert binary/unreadable text documents to plain markdown-like text Uses pandoc to convert binary/unreadable text documents to plain markdown-like text
Extensions: .epub, .odt, .docx, .fb2, .ipynb Extensions: .epub, .odt, .docx, .fb2, .ipynb
- **poppler** - **poppler**
Uses pdftotext (from poppler-utils) to extract plain text from PDF files Uses pdftotext (from poppler-utils) to extract plain text from PDF files
Extensions: .pdf Extensions: .pdf
@ -114,7 +134,6 @@ Adapters:
Reads a tar file as a stream and recurses down into its contents Reads a tar file as a stream and recurses down into its contents
Extensions: .tar Extensions: .tar
* **sqlite** * **sqlite**
Uses sqlite bindings to convert sqlite databases into a simple plain text format Uses sqlite bindings to convert sqlite databases into a simple plain text format
Extensions: .db, .db3, .sqlite, .sqlite3 Extensions: .db, .db3, .sqlite, .sqlite3
@ -131,7 +150,6 @@ The following adapters are disabled by default, and can be enabled using '--rga-
Uses tesseract to run OCR on images to make them searchable. May need -j1 to prevent overloading the system. Make sure you have tesseract installed. Uses tesseract to run OCR on images to make them searchable. May need -j1 to prevent overloading the system. Make sure you have tesseract installed.
Extensions: .jpg, .png Extensions: .jpg, .png
## USAGE: ## USAGE:
> rga \[RGA OPTIONS\] \[RG OPTIONS\] PATTERN \[PATH \...\] > rga \[RGA OPTIONS\] \[RG OPTIONS\] PATTERN \[PATH \...\]

BIN
doc/rga-fzf.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB