diff options
author | Tim Adler <toadle@users.noreply.github.com> | 2020-10-21 06:33:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-21 10:03:56 +0530 |
commit | f3e122fc32489feff3cbe804d881fe6c9077bef5 (patch) | |
tree | 79b67868de6cdcf18477fde5f37a0d044cdb1ad9 | |
parent | 65bffda6eb786e7d99983a99657069ff469e35c7 (diff) | |
download | nnn-f3e122fc32489feff3cbe804d881fe6c9077bef5.tar.gz |
Support zoxide for jumping (#764)
* Create zoxide
* Delete zoxide
* Add files via upload
-rwxr-xr-x | plugins/autojump | 16 |
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 |