我想在 vim 中执行 grep -r -l "index.php"
。我也在使用 NERDTree 插件。我试过命令 :!
但在此之后它声明
Press ENTER or type command to continue
我试着输入一个命令,它立即恢复到 vim。
最佳答案
为了运行一个外部命令,你可以在它前面加上:!
在你的情况下,
:!grep -r -l "index.php"
也就是说,当您在 vim 中时,您应该在 :!
之后键入命令。
使用vimgrep
,你可以做到
:vimgrep /\cindex\.php/ **
请检查 vim-tips-working-with-external-commands 中给出的示例
but after this it states "Press ENTER or type command to continue"
这是预期的结果。对于 grep 命令,您可以在这一行的顶部看到结果。
检查 vimgrep
、Silver Searcher
等以获得更好的工作流程。一些熟悉它们的链接
关于linux - 有没有办法在 NERDTree(vim) 中编辑文件时执行 cli 命令?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36046658/