From eec0e6d18ef03ec85772606521f2f141b0d4a1a3 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Mon, 27 Apr 2020 00:05:11 +0530 Subject: Various plugin improvements --- plugins/fzopen | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'plugins/fzopen') diff --git a/plugins/fzopen b/plugins/fzopen index 9f5ff05..e262d68 100755 --- a/plugins/fzopen +++ b/plugins/fzopen @@ -4,14 +4,18 @@ # Opens in $VISUAL or $EDITOR if text # Opens other type of files with xdg-open # -# Requires: fzf/fzy, xdg-open +# Requires: fd/find, fzf/fzy/skim, xdg-open # # Shell: POSIX compliant # Author: Arun Prakash Jana if which fzf >/dev/null 2>&1; then cmd="$FZF_DEFAULT_COMMAND" - [ -z "$cmd" ] && cmd="find . -type f 2>/dev/null" + if which fd >/dev/null 2>&1; then + [ -z "$cmd" ] && cmd="fd -t f 2>/dev/null" + else + [ -z "$cmd" ] && cmd="find . -type f 2>/dev/null" + fi entry="$(eval "$cmd" | fzf --delimiter / --nth=-1 --tiebreak=begin --info=hidden)" # To show only the file name # entry=$(find . -type f 2>/dev/null | fzf --delimiter / --with-nth=-1 --tiebreak=begin --info=hidden) -- cgit v1.2.3-70-g09d2