From 5b7448bac9506830c72da860f6e44cdbec5a6344 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Wed, 20 Nov 2019 18:47:26 +0530 Subject: [PATCH] Various plugin fixes 1. getplugs should work even if nnn is not run 2. Remove redundant ./ prefix 3. Update plugin docs --- plugins/README.md | 2 +- plugins/fzcd | 3 +++ plugins/getplugs | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/README.md b/plugins/README.md index 2fb44b06..47b2eaa8 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -47,7 +47,7 @@ Plugins extend the capabilities of `nnn`. They are _executable_ scripts (or bina | ringtone | sh | date, ffmpeg | Create a variable bitrate mp3 ringtone from file | | splitjoin | sh | split, cat | Split file or join selection | | suedit | sh | sudoedit/sudo/doas | Edit file using superuser permissions | -| sxiv | sh | sxiv | Browse images in dir, set wallpaper, copy path ([config](https://wiki.archlinux.org/index.php/Sxiv#Assigning_keyboard_shortcuts)), [rename](https://github.com/jarun/nnn/wiki/Basic-use-cases#browse-rename-images)| +| sxiv | sh | sxiv | Browse images, set wallpaper, copy path ([config](https://wiki.archlinux.org/index.php/Sxiv#Assigning_keyboard_shortcuts)), [rename](https://github.com/jarun/nnn/wiki/Basic-use-cases#browse-rename-images)| | thumb | sh | [lsix](https://github.com/hackerb9/lsix) | View thumbnail of an image or dir of images | | transfer | sh | curl | Upload file to transfer.sh | | treeview | sh | tree | Informative tree output in `$EDITOR` | diff --git a/plugins/fzcd b/plugins/fzcd index a75d5587..c4694e3c 100755 --- a/plugins/fzcd +++ b/plugins/fzcd @@ -28,5 +28,8 @@ if [ "$?" -eq "0" ]; then *directory*) ;; *) sel=$(dirname "$sel") ;; esac + + # Remove "./" prefix + sel="$(echo "$sel" | cut -c 3-)" nnn_cd "$PWD/$sel" fi diff --git a/plugins/getplugs b/plugins/getplugs index 1e2497ac..34f599f4 100755 --- a/plugins/getplugs +++ b/plugins/getplugs @@ -44,6 +44,7 @@ if [ -d $PLUGIN_DIR ]; then tar -C $CONFIG_DIR -czf $CONFIG_DIR"plugins-$(date '+%Y%m%d%H%M').tar.gz" plugins/ fi +mkdir -p $PLUGIN_DIR cd $CONFIG_DIR curl -Ls -O https://github.com/jarun/nnn/archive/master.tar.gz tar -zxf master.tar.gz