From ab0dc52c497ea59348b77623e7e34e9d28bcc0a8 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Sun, 24 Jul 2022 16:20:54 +0530 Subject: [PATCH] Add example to quick find in subtree and nuke --- plugins/README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/plugins/README.md b/plugins/README.md index 29c89d12..e57890e1 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -319,6 +319,23 @@ done < "$NNN_FIFO" & disown ``` +#### Quick `find` the first match in subtree and open in `nuke` + +```sh +#!/usr/bin/env sh + +NUKE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins/nuke" + +printf "file name: " +read -r pattern + +entry=$(find . -type f -iname "$pattern" -print -quit 2>/dev/null) + +if [ -n "$entry" ]; then + "$NUKE" "$entry" +fi +``` + #### Quick find (using `fd`) ```sh