mirror of
https://github.com/jarun/nnn.git
synced 2025-01-15 13:26:37 +00:00
Add example to quick find in subtree and nuke
This commit is contained in:
parent
f829afe60b
commit
ab0dc52c49
|
@ -319,6 +319,23 @@ done < "$NNN_FIFO" &
|
||||||
disown
|
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`)
|
#### Quick find (using `fd`)
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
|
Loading…
Reference in a new issue