Browse Source

PR #399: add autojump plugin

master
Arun Prakash Jana 5 years ago
parent
commit
ef09f42720
No known key found for this signature in database GPG Key ID: A75979F35C080412
2 changed files with 18 additions and 0 deletions
  1. +1
    -0
      plugins/README.md
  2. +17
    -0
      plugins/autojump

+ 1
- 0
plugins/README.md View File

@@ -14,6 +14,7 @@ Plugins extend the capabilities of `nnn`. They are _executable_ scripts (or bina

| Plugin (a-z) | Description | Lang | Deps |
| --- | --- | --- | --- |
| autojump | Navigate to dir/path | sh | autojump |
| boom | Play random music from dir | sh | [moc](http://moc.daper.net/) |
| dups | List non-empty duplicate files in current dir | sh | find, md5sum,<br>sort uniq xargs |
| chksum | Create and verify checksums | sh | md5sum,<br>sha256sum |


+ 17
- 0
plugins/autojump View File

@@ -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

Loading…
Cancel
Save