所以,摆弄EasyGrep.vim插件,尝试让它进入适合我的状态.我正在使用它来递归搜索Rails项目.我几乎得到了我想要它,这是我修改的EasyGrep执行的grep命令的一个例子:
:grep -R -i --include=*.rb --include=*.rbw --include=*.gem --include=*.gemspec --include=[rR]akefile --include=*.erb --include=*.rhtml SEARCH_WORD .
Run Code Online (Sandbox Code Playgroud)
在光标下找到该单词,并在快速列表中打开搜索结果.
唯一的问题是,:grep似乎会自动将包含第一个匹配的文件打开到当前缓冲区,我不希望它这样做,因为那时我丢失了我刚才看到的文件.
有谁知道我怎么能防止这种行为?或者,至少一个hacky解决方法重新打开我正在搜索的文件?
:vimgrep不是一个选项 - 它太慢了.
Rei*_*chs 22
来自:help :grep:
Just like ":make", but use 'grepprg' instead of 'makeprg' and 'grepformat' instead of 'errorformat'.
来自:help :make:
If [!] is not given the first error is jumped to.
所以: :grep!