PR #399: add autojump plugin

This commit is contained in:
Arun Prakash Jana 2019-12-10 22:29:15 +05:30
parent 92bba0cbf8
commit ef09f42720
No known key found for this signature in database
GPG key ID: A75979F35C080412
2 changed files with 18 additions and 0 deletions

View file

@ -14,6 +14,7 @@ Plugins extend the capabilities of `nnn`. They are _executable_ scripts (or bina
| Plugin (a-z) | Description | Lang | Deps | | 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/) | | 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 | | 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 | | chksum | Create and verify checksums | sh | md5sum,<br>sha256sum |

17
plugins/autojump Executable file
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