From ef09f427209eab13c65d8abe986d67bd9b38a33d Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Tue, 10 Dec 2019 22:29:15 +0530 Subject: PR #399: add autojump plugin --- plugins/autojump | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 plugins/autojump (limited to 'plugins/autojump') diff --git a/plugins/autojump b/plugins/autojump new file mode 100755 index 0000000..d158113 --- /dev/null +++ b/plugins/autojump @@ -0,0 +1,17 @@ +#!/usr/bin/env sh + +# Description: Navigate to directory using autojump +# +# Requires: autojump - https://github.com/wting/autojump +# +# Shell: POSIX compliant +# Author: Marty Buchaus + +if which autojump >/dev/null 2>&1; then + printf "jump to: " + read -r dir + odir="$(autojump "$dir")" + printf "%s" "0$odir" > "$NNN_PIPE" +else + exit 1 +fi -- cgit v1.2.3-70-g09d2