浏览代码

Add quick find (fd) and grep (rg) plugin examples

master
Arun Prakash Jana 4 年前
父节点
当前提交
509f069818
找不到此签名对应的密钥 GPG 密钥 ID: A75979F35C080412
共有 1 个文件被更改,包括 30 次插入0 次删除
  1. +30
    -0
      plugins/README.md

+ 30
- 0
plugins/README.md 查看文件

@@ -250,6 +250,36 @@ There are many plugins provided by `nnn` which can be used as examples. Here are
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.


正在加载...
取消
保存