aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/fzopen
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-04-27 00:05:11 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-04-27 00:05:40 +0530
commiteec0e6d18ef03ec85772606521f2f141b0d4a1a3 (patch)
treeeb12e485c6323d482462575ffe37efb17bfee3ec /plugins/fzopen
parentbabf379a74c6727b82ba593ca952be3a0bba50e3 (diff)
downloadnnn-eec0e6d18ef03ec85772606521f2f141b0d4a1a3.tar.gz
Various plugin improvements
Diffstat (limited to 'plugins/fzopen')
-rwxr-xr-xplugins/fzopen8
1 files changed, 6 insertions, 2 deletions
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)