aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tim Adler <toadle@users.noreply.github.com>2020-10-21 06:33:56 +0200
committerGravatar GitHub <noreply@github.com>2020-10-21 10:03:56 +0530
commitf3e122fc32489feff3cbe804d881fe6c9077bef5 (patch)
tree79b67868de6cdcf18477fde5f37a0d044cdb1ad9
parent65bffda6eb786e7d99983a99657069ff469e35c7 (diff)
downloadnnn-f3e122fc32489feff3cbe804d881fe6c9077bef5.tar.gz
Support zoxide for jumping (#764)
* Create zoxide * Delete zoxide * Add files via upload
-rwxr-xr-xplugins/autojump16
1 files changed, 13 insertions, 3 deletions
diff --git a/plugins/autojump b/plugins/autojump
index 3bfe228..c4ba5d1 100755
--- a/plugins/autojump
+++ b/plugins/autojump
@@ -16,16 +16,26 @@ if [ -z "$NNN_PIPE" ]; then
fi
if which jump >/dev/null 2>&1; then
- printf "jump to: "
+ printf "jump to : "
read -r dir
odir="$(jump cd "$dir")"
printf "%s" "0c$odir" > "$NNN_PIPE"
elif which autojump >/dev/null 2>&1; then
- printf "jump to: "
+ printf "jump to : "
read -r dir
odir="$(autojump "$dir")"
printf "%s" "0c$odir" > "$NNN_PIPE"
+elif which zoxide >/dev/null 2>&1; then
+ if which fzf >/dev/null 2>&1; then
+ odir="$(zoxide query -i --)"
+ printf "%s" "0c$odir" > "$NNN_PIPE"
+ else
+ printf "jump to : "
+ read -r dir
+ odir="$(zoxide query -- "$dir")"
+ printf "%s" "0c$odir" > "$NNN_PIPE"
+ fi
else
- printf "jump/autojump missing"
+ printf "No supported autojump script found. (jump/autojump/zoxide are supported)"
read -r _
fi