I'm not sure what you're comparing here. vimgrep offers the
flexibility of Vim's full regexp parsing engine. Last I tried
VS, it's regexps were anemic at best. So if all you need is
simple string searching, you may be interested in things like
ctags which index specified files and allow for rapid jumping.
However, if you need the power of vim's regexp engine, AFAIK, you
simply *can't* get that in VS.
There are also a lot of other variables to consider...
What OS? (I find Vim on Linux to have better filesystem response
than Vim on Win32...mostly due to the underlying filesystem types
and caching)
What app is responsible for keeping any search-result cache
up-to-date? How frequently is such a cache updated? How
detailed is the cache (can you exploit it for arbitrary regexps
or does it only help for fixed strings, or even just fixed "words")?
If all you're looking for is fixed text, your OS search
functionality is likely your best bet. Just use Spotlight (Mac);
Beagle, Tracker, Recoll (Linux); Windows Search (Win32); or
Google Desktop Search (which is rumored to run on multiple
platforms).
Please include your usage pattern and timing results on the same
hardware so it's easier to help you.
-tim
On Sun, Feb 24, 2008 at 10:16 AM, epanda <callin...@hotmail.fr> wrote:
>
> I am on a windows OS and I prefer vimgrep than a VS search tool.
>
> My project has about 450 files and I have done a test with a friend ho
> was working with VS to to a simple search of include file.
>
> VS find the four files in 3-4 seconds
> Vimgrep in more than 20-30 seconds....I was afraid.
>
> I know ctags and use them but it has the inconvenient that you must
> refresh database file.
>
> I am a pro unix vim but I just note that vimgrep do the things in 30
> seconds.
> I am worry now
>
You can use the several grep utilities available in the GNU grep package
or you can use the MS-Windows findstr utility to search for patterns
across multiple files and directories quickly.
The following Vim plugins integrate these utilities with Vim:
http://vim.sourceforge.net/scripts/script.php?script_id=311
http://vim.sourceforge.net/scripts/script.php?script_id=1575
- Yegappan
Is there some way to disable autocommadns automatically whenever you
perform a :vimgrep, and re-enable them afterwards? This seems like a
good way to speed things up significantly, since (from what I
understand) Vim loads each file into memory normally in order to
search it. There may be some unforseen problems I suppose.
I guess I could just create a command called Vimgrep that does this,
and passes all arguments on to :vimgrep, but that sort of thing seems
like it would be fairly annoying.
>>
>>
>> >
>> > VS find the four files in 3-4 seconds
>> > Vimgrep in more than 20-30 seconds....I was afraid.
>> >
>>
>>
>>
>>
>>
>
>Is there some way to disable autocommadns automatically whenever you
>perform a :vimgrep, and re-enable them afterwards?
>
>
>
Filetype autocommands are disabled when vimgrepping.
The problem/cause might be found in the win32 code,
at least on my linux system I get reasonable performance
( ~500 files,~ 5Mb, ~5 sec ).
-ap
--
:wq
>
>Is there some way to disable autocommadns automatically whenever you
>perform a :vimgrep, and re-enable them afterwards? This seems like a
>good way to speed things up significantly, since (from what I
>understand) Vim loads each file into memory normally in order to
>search it. There may be some unforseen problems I suppose.
>
>I guess I could just create a command called Vimgrep that does this,
>and passes all arguments on to :vimgrep, but that sort of thing seems
>like it would be fairly annoying.
>
>
>
Well, the Vimgrep solution allows one to avoid any events; certainly
vimgrep has no such options. Perhaps
com! -nargs=* Vimgrep let s:eikeep=&ei|set ei=all|vimgrep <args>|let
&ei=s:eikeep|unlet s:eikeep
will do it.
Regards,
Chip Campbell
Regards,
Chip Campbell
On Mon, Feb 25, 2008 at 11:45 AM, A.Politz <pol...@fh-trier.de> wrote:
> The problem/cause might be found in the win32 code,
> at least on my linux system I get reasonable performance
> ( ~500 files,~ 5Mb, ~5 sec ).
It *might* have something to do with file globbing. It starts out slow
and seems to scale up exponentially:
http://mail.google.com/mail/#label/vim/11819be8d402f8bf
I haven't done any testing to see if that's related to your problem,
but I thought I'd throw it out there. I'm pretty sure vimgrep calls
the same globbing routine that args does (dos_expandpath), so it would
suffer from the same scaling issue.
Cheers,
Eric
One issue I normally notice with disabling all events and going through
buffers (at least when :bufdo is used) is that when you visit these
buffers later they appear without any syntax highlighting, so you have
to an :e to trigger fresh autoload events and get filetype detected.
--
Thanks,
Hari
>
> Regards,
> Chip Campbell
>
>
> >
>
Regards,
Chip Campbell
Or maybe you could run ":vimgrep" with ei=all, then set ei= and reload (only)
the file containing the first match if it hasn't got syntax highlights.
Ulterior uses of ":cnext" ":cnf" ext. ought to trigger FileType, Syntax, and
other autocommands.
Best regards,
Tony.
--
An Army travels on her stomach.