m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-19 00:53:42 -05:00

Quote fif parameters so it can take phrases

Diogo Lemos
2019-08-25 21:33:23 +01:00
parent caecc30997
commit 1f3761c5ce

@@ -291,7 +291,7 @@ ag --nobreak --nonumbers --noheading . | fzf
# find-in-file - usage: fif <searchTerm> # find-in-file - usage: fif <searchTerm>
fif() { fif() {
if [ ! "$#" -gte 1 ]; then echo "Need a string to search for!"; return 1; fi if [ ! "$#" -gte 1 ]; then echo "Need a string to search for!"; return 1; fi
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 {}" 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' {}"
} }
``` ```