From a1f25f2ed00b7b0d8eb00b92a01715d35e9fa84b Mon Sep 17 00:00:00 2001 From: gaerfield Date: Thu, 16 May 2019 02:19:41 +0200 Subject: [PATCH] ripgrep search and preview --- Examples.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Examples.md b/Examples.md index 8abc4ee..65e79ba 100644 --- a/Examples.md +++ b/Examples.md @@ -245,6 +245,10 @@ grep --line-buffered --color=never -r "" * | fzf # with ag - respects .agignore and .gitignore ag --nobreak --nonumbers --noheading . | fzf + +# using ripgrep combined with preview +# find-in-file - usage: fif +fif() { rg --files-with-matches --no-messages $1 | fzf --preview "highlight -O ansi -l {} 2> /dev/null | rg --colors 'match:bg:yellow' --ignore-case --pretty --context 10 $1 || rg --ignore-case --pretty --context 10 $1 {}" } ``` ### Command history