plugins/README.md | 30 ++++++++++++++++++++++++++++++ diff --git a/plugins/README.md b/plugins/README.md index 2af105e75b3d14a2afd108f03885660d4c541a4f..fbc8628bdf5401297fd8ff4e89e618252018349d 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -250,6 +250,36 @@ done < "$NNN_FIFO" & disown ``` +- Quick find (using `fd`) + ```sh + #!/usr/bin/env sh + + . "$(dirname "$0")"/.nnn-plugin-helper + + printf "pattern: " + read -r pattern + + if ! [ -z "$pattern" ]; then + printf "%s" "+l" > "$NNN_PIPE" + eval "fd -HI $pattern -0" > "$NNN_PIPE" + fi + ``` + +- Quick grep (using `rg`) + ```sh + #!/usr/bin/env sh + + . "$(dirname "$0")"/.nnn-plugin-helper + + printf "pattern: " + read -r pattern + + if ! [ -z "$pattern" ]; then + printf "%s" "+l" > "$NNN_PIPE" + eval "rg -l0 --hidden -S $pattern" > "$NNN_PIPE" + fi + ``` + ## Contributing plugins 1. Add informative sections like _Description_, _Notes_, _Dependencies_, _Shell_, _Author_ etc. in the plugin.