Add automatic choice of greplikes/fzflikes
This commit is contained in:
parent
949e071b97
commit
348621d824
2 changed files with 25 additions and 4 deletions
25
.config/shell/rc.d/alias-fuzzy-finder-to-fzf.sh
Normal file
25
.config/shell/rc.d/alias-fuzzy-finder-to-fzf.sh
Normal file
|
@ -0,0 +1,25 @@
|
|||
#!/bin/sh
|
||||
|
||||
# check for existence of fuzzy finders. If found, substitute fzf with it.
|
||||
# order is skim > fzy > fzf > nothing
|
||||
if type sk >/dev/null 2>&1; then
|
||||
alias fzf=sk
|
||||
elif type fzy >/dev/null 2>&1; then
|
||||
alias fzf=fzy
|
||||
elif type fzf >/dev/null 2>&1; then
|
||||
alias fzf=fzf
|
||||
else
|
||||
echo "[WARNING]: No fuzzy finder found - install sk/fzy/fzf to enable functionality"
|
||||
fi
|
||||
|
||||
# check for existence of greplikes. If found, substitute fzf with it.
|
||||
# order is skim > fzy > fzf > nothing
|
||||
if type rg >/dev/null 2>&1; then
|
||||
alias rg=rg
|
||||
elif type ag >/dev/null 2>&1; then
|
||||
alias rg=ag
|
||||
elif type ack >/dev/null 2>&1; then
|
||||
alias rg=ack
|
||||
else
|
||||
echo "[WARNING]: No grep-like found - install rg/ag/ack to enable functionality"
|
||||
fi
|
|
@ -1,4 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# check for existence of fzy. If found, substitute fzf with it.
|
||||
type fzy >/dev/null 2>&1 && alias fzf=fzy
|
Loading…
Reference in a new issue