aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/autojump
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-01-02 04:15:17 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-01-02 04:15:17 +0530
commitff72917e72a783081db4b73939d6d094c863eaf7 (patch)
treef0b31071731b6b9a353a12ec06cb856c4cc8531b /plugins/autojump
parentc44d5b57bd8eb6bb6ff72fff76adc2129e349aa8 (diff)
downloadnnn-ff72917e72a783081db4b73939d6d094c863eaf7.tar.gz
Plugin rename
Diffstat (limited to 'plugins/autojump')
-rwxr-xr-xplugins/autojump19
1 files changed, 19 insertions, 0 deletions
diff --git a/plugins/autojump b/plugins/autojump
new file mode 100755
index 0000000..b30530f
--- /dev/null
+++ b/plugins/autojump
@@ -0,0 +1,19 @@
+#!/usr/bin/env sh
+
+# Description: Navigate to directory using autojump
+#
+# Requires: autojump - https://github.com/wting/autojump
+#
+# Note: autojump STORES NAVIGATION PATTERNS
+#
+# 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