diff options
author | 2019-12-10 22:29:15 +0530 | |
---|---|---|
committer | 2019-12-10 22:30:35 +0530 | |
commit | ef09f427209eab13c65d8abe986d67bd9b38a33d (patch) | |
tree | 95ad37453324d818544c5ad20846c45f0afa8d61 /plugins/autojump | |
parent | 92bba0cbf8f916ee7fe5b0db7a9581c9ff4f65be (diff) | |
download | nnn-ef09f427209eab13c65d8abe986d67bd9b38a33d.tar.gz |
PR #399: add autojump plugin
Diffstat (limited to 'plugins/autojump')
-rwxr-xr-x | plugins/autojump | 17 |
1 files changed, 17 insertions, 0 deletions
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 |