1
1
mirror of https://github.com/jarun/nnn.git synced 2024-11-05 01:20:18 +03:00
nnn/plugins/finder
Arun Prakash Jana a7fd4957dd
shellcheck fixes
2020-11-22 20:30:52 +05:30

29 lines
744 B
Bash
Executable File

#!/usr/bin/env sh
# Description: Run custom search and list results in smart context
#
# Note: To enable multi select in fzf, export the following:
# - export FZF_DEFAULT_OPTS='--bind ctrl-a:select-all,ctrl-d:deselect-all,ctrl-t:toggle'
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana
. "$(dirname "$0")"/.nnn-plugin-helper
printf "Examples:\n"
printf " find . -name \"pattern*\" -print0\n"
printf " fd pattern -0\n"
printf " find -maxdepth 1 -size +100M -print0\n"
printf " fd -d 2 -S +100M -0\n"
printf " grep -rlZ pattern\n"
printf " rg -l0 pattern\n"
printf " fzf -m | tr %s %s\n\n" "'\n'" "'\0'"
printf "cmd: "
read -r cmd
if [ -n "$cmd" ]; then
printf "%s" "+l" > "$NNN_PIPE"
eval "$cmd" > "$NNN_PIPE"
fi