aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/jump
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-12-16 05:55:15 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-12-16 05:55:15 +0530
commit5c76187b61295d2cc7b4d026e294536c6e410636 (patch)
treea29a6c4399494caf280c85bb28eb6491cbdc3c24 /plugins/jump
parent208a6605f55474abb1ba45296749177752895f5f (diff)
downloadnnn-5c76187b61295d2cc7b4d026e294536c6e410636.tar.gz
Update docs
Diffstat (limited to 'plugins/jump')
-rwxr-xr-xplugins/jump19
1 files changed, 19 insertions, 0 deletions
diff --git a/plugins/jump b/plugins/jump
new file mode 100755
index 0000000..b30530f
--- /dev/null
+++ b/plugins/jump
@@ -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