commit ab0dc52c497ea59348b77623e7e34e9d28bcc0a8 parent f829afe60bc32c949224d0ec85c590ebf8a9b61c Author: Arun Prakash Jana <engineerarun@gmail.com> Date: Sun, 24 Jul 2022 16:20:54 +0530 Add example to quick find in subtree and nuke Diffstat:
| M | plugins/README.md | | | 17 | +++++++++++++++++ |
1 file changed, 17 insertions(+), 0 deletions(-)
diff --git 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