i'm pretty used to doing either:
:vimgrep /whatever/ **/*
or
:vimgrep /whatever/ **/*.txt
but is there a way with vim globbing to do, say, 2 file types? i guess i w开发者_如何转开发ant something that would work kind of like this:
:vimgrep /whatever/ \*\*/.(txt|vb)
:vimgrep /whatever/ *.{txt,vb}
Is what you're looking for, I believe.
Try this
:vimgrep /whatever/ *.txt *.vb
I don't use vimgrep, but an (undocumented) external perl wrapper around find+grep+xargs. From vim, your search would become:
:Searchfile txt,vb whatever
You might be interested in a plugin I wrote called EasyGrep. It allows you to automatically search for files that match the one you're editing (with an option for recursive search) as well as files that are related to the current file.
For example: when test.cpp is open, files that match any one of *.cpp *.hpp *.cxx *.hxx *.cc *.c *.h will be searched when a search is initiated. You can also define your own relationships or create a custom one on demand.
精彩评论