mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 05:41:31 +00:00
Tweak fzopen to show parent dir and filename with fzf
This commit is contained in:
parent
9f1b51b004
commit
a1b8631d96
|
@ -10,15 +10,15 @@
|
||||||
# Author: Arun Prakash Jana
|
# Author: Arun Prakash Jana
|
||||||
|
|
||||||
if which fzf >/dev/null 2>&1; then
|
if which fzf >/dev/null 2>&1; then
|
||||||
fuzzy=fzf
|
entry=$(find . -type f 2>/dev/null | 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
|
elif which fzy >/dev/null 2>&1; then
|
||||||
fuzzy=fzy
|
entry=$(find . -type f 2>/dev/null | fzy)
|
||||||
else
|
else
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
entry="$(find . -type f 2>/dev/null | "$fuzzy")"
|
|
||||||
|
|
||||||
case "$(file -biL "$entry")" in
|
case "$(file -biL "$entry")" in
|
||||||
*text*)
|
*text*)
|
||||||
"${VISUAL:-$EDITOR}" "$entry" ;;
|
"${VISUAL:-$EDITOR}" "$entry" ;;
|
||||||
|
|
Loading…
Reference in a new issue