m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-18 16:45:38 -05:00

fif - add input validation

Diogo Lemos
2019-06-13 18:17:05 +01:00
parent 548c30300b
commit 8e84ccb931

@@ -249,7 +249,10 @@ ag --nobreak --nonumbers --noheading . | fzf
# using ripgrep combined with preview
# find-in-file - usage: fif <searchTerm>
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 {}" }
fif() {
if [ ! "$#" -gt 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 {}"
}
```
### Command history