linux - 有没有办法在 NERDTree(vim) 中编辑文件时执行 cli 命令?

标签 linux vim command-line-interface nerdtree

我想在 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 命令,您可以在这一行的顶部看到结果。

检查 vimgrepSilver Searcher 等以获得更好的工作流程。一些熟悉它们的链接

Faster Grepping in Vim
Search multiple files with :vimgrep

关于linux - 有没有办法在 NERDTree(vim) 中编辑文件时执行 cli 命令?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36046658/

相关文章:

vim - 任何 Emacs 命令,如 vim 中的粘贴模式?

windows - 'touch' 不是内部或外部命令,也不是可运行的程序 或批处理文件

linux - Linux/Mac 上的 Silverlight

linux - git push 后项目从 gitweb 消失

vim - 如何在vim中的文件名头部添加 "# "?

php - Vim:显示 PHP 的函数提示或签名

linux - 使用 Linux Find 并将内容通过管道传送到 S3 存储桶

php - PHP 如何取消 RabbitMQ 中的消费者?

linux - 我可以在终端中执行文本文档中编写的命令吗

linux - linux内核中使用的分页和预分页技术