aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/jump
blob: b30530fe861ff55d81af0bd27da4f47664a61db4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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