vim - 我如何在 vim netrw 中 grep?

标签 vim grep netrw

如何在 Vim 的 netrw 中执行 grep? ctrl-p可以这样用,有没有类似grep的插件?

例如,当我在一个目录中时,我想要一个包含 this 或 that 关键字的文件列表。

最佳答案

Netrw 确实有“那个特性”;请参阅 :help netrw-star。你可以做例如 :Explore */filepat或更普遍地使用以下模式之一:

*/filepat   files in current directory which satisfy filepat
**/filepat  files in current directory or below which satisfy the
            file pattern
*//pattern  files in the current directory which contain the
            pattern (vimgrep is used)
**//pattern files in the current directory or below which contain
            the pattern (vimgrep is used)

使用 :Pexplore:Nexplore转到上一个/下一个匹配文件(和 @: 以重复选择的命令);点击<cr>进入文件。

关于vim - 我如何在 vim netrw 中 grep?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25976167/

相关文章:

python - 如何为非标准 Python 库添加自动完成功能到 Vim?

linux - Grep:仅显示正则表达式组中匹配的内容

regex - 无法用grep提取

vim - 我可以在 netrw 中使用通配符吗?

vim - 使用 vim netrw 打开文件时跳转到最后位置

Vim Python 模式折叠

vim - Vim 真的有那么好吗?

vim - 在 Vim 中如何在同名的 .h 和 .cpp 文件之间快速切换?

shell - 如何使用 grep 命令确定字符串是否包含换行符?

vim - 如何使 vim 中的 netrw 像 Visual Studio 中的解决方案资源管理器一样工作