From 348621d824f0ab6c0d79c989486a04b0e6406963 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 17 Jun 2019 08:47:21 +0200 Subject: [PATCH] Add automatic choice of greplikes/fzflikes --- .../shell/rc.d/alias-fuzzy-finder-to-fzf.sh | 25 +++++++++++++++++++ .config/shell/rc.d/fzy-to-fzf.sh | 4 --- 2 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 .config/shell/rc.d/alias-fuzzy-finder-to-fzf.sh delete mode 100644 .config/shell/rc.d/fzy-to-fzf.sh diff --git a/.config/shell/rc.d/alias-fuzzy-finder-to-fzf.sh b/.config/shell/rc.d/alias-fuzzy-finder-to-fzf.sh new file mode 100644 index 0000000..775d4fc --- /dev/null +++ b/.config/shell/rc.d/alias-fuzzy-finder-to-fzf.sh @@ -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 diff --git a/.config/shell/rc.d/fzy-to-fzf.sh b/.config/shell/rc.d/fzy-to-fzf.sh deleted file mode 100644 index 055996e..0000000 --- a/.config/shell/rc.d/fzy-to-fzf.sh +++ /dev/null @@ -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