aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/fzopen
diff options
context:
space:
mode:
authorGravatar Krisan Alifari <krisan.alifari@gmail.com>2020-04-12 20:36:59 +0700
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-04-12 22:39:24 +0530
commitaa7f1dabdd7954989b5303c258733673dca26228 (patch)
treec81fbcdd403dcf47c0276735cf4e5561d42c4634 /plugins/fzopen
parentf54d51c863606456bb4b715e5a2bc98c007be0be (diff)
downloadnnn-aa7f1dabdd7954989b5303c258733673dca26228.tar.gz
Support $FZF_DEFAULT_COMMAND on fzopen plugin (#514)
Diffstat (limited to 'plugins/fzopen')
-rwxr-xr-xplugins/fzopen4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/fzopen b/plugins/fzopen
index 7205b7a..068db1e 100755
--- a/plugins/fzopen
+++ b/plugins/fzopen
@@ -10,7 +10,9 @@
# Author: Arun Prakash Jana
if which fzf >/dev/null 2>&1; then
- entry=$(find . -type f 2>/dev/null | fzf --delimiter / --nth=-1 --tiebreak=begin --info=hidden)
+ cmd="$FZF_DEFAULT_COMMAND"
+ [ -z "$cmd" ] && cmd="find . -type f 2>/dev/null"
+ 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)
elif which fzy >/dev/null 2>&1; then