gpt4 book ai didi

vim - 我如何在 vim netrw 中 grep?

转载 作者:行者123 更新时间:2023-12-04 19:40:37 24 4
gpt4 key购买 nike

如何在 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com