News for hackers. Stuff that matters.
Re:Ctrl-P for Vim: Pure Vimscript Command-T by ghost91 on Monday April 30, 2012 @12:02PM (#3909778)
https://github.com/wincent/Command-T

Is also quite good.

It would cool to have a performance comparison

Re:Ctrl-P for Vim: Pure Vimscript Command-T by michael_michael on Monday April 30, 2012 @12:39PM (#3909980)
As a quick and dirty test I tried running both Command-T and Ctrl-P against a directory tree containing some 26,000 XML files. Command-T takes roughly 10-15 seconds to become responsive. Ctrl-P chokes and requires a Vim restart after invoking it against this directory.
Re:Ctrl-P for Vim: Pure Vimscript Command-T by moe on Monday April 30, 2012 @02:09PM (#3910481)
That should be a fairly trivial fix in both of them.

Simply abort the scanning after a configurable threshold (either seconds or files).

Needless to say that, yes, this must be implemented.

I've choked my vim more than once by accidentally running Command-T or FuzzyFinder in the "wrong" directory. That should not happen.

Re:Ctrl-P for Vim: Pure Vimscript Command-T by notJim on Tuesday May 01, 2012 @12:44AM (#3913022)
Command-T definitely has the feature you're talking about (CommandTMaxFiles I think.) I'm not sure about CtrlP.
Re:Ctrl-P for Vim: Pure Vimscript Command-T by amadeus on Monday April 30, 2012 @02:35PM (#3910638)
If you are on Unix, add this to your vimrc and the directory indexing speed should go through the roof:

https://gist.github.com/ee14d6ecb9196a07da56

Re:Ctrl-P for Vim: Pure Vimscript Command-T by jamesgeck0 on Monday April 30, 2012 @05:41PM (#3911676)
Is that offloading the task of scanning file names to the find command?
Re:Ctrl-P for Vim: Pure Vimscript Command-T by jpk on Monday April 30, 2012 @09:54PM (#3912608)
Looks like find is piped into head, though. So it would only index the first ten?
Re:Ctrl-P for Vim: Pure Vimscript Command-T by aidenn0 on Tuesday May 01, 2012 @02:42AM (#3913308)
No, it's the first g:ctrlp_max_files which is defined as 10000
Re:Ctrl-P for Vim: Pure Vimscript Command-T by jpk on Tuesday May 01, 2012 @10:00AM (#3914314)
Oh, true. Good call.
Re:Ctrl-P for Vim: Pure Vimscript Command-T by shurane on Wednesday May 02, 2012 @10:47PM (#3922163)
Is there a reason that Ctrl-P, FuzzyFinder, and Command-T choke on large directories? On windows, I've used this piece of software called Everything Search that seems to index the entire filesystem (say around 30,000 files) in under 5 seconds. That's really impressive and I love using it for that.

But it makes me sad to use these vim extensions choking on directories of similar size. Maybe NTFS vs ext4 has something to do with it?

Re:Ctrl-P for Vim: Pure Vimscript Command-T by greyfade on Monday April 30, 2012 @12:11PM (#3909826)
I was never able to get Command-T to work. CtrlP works out of the box without extra work.
Re:Ctrl-P for Vim: Pure Vimscript Command-T by roelbondoc on Monday April 30, 2012 @12:07PM (#3909803)
The main thing that attracted me to Ctrl-p was that it is written in pure vimscript. Command-T, however, requires your vim to be compiled with Ruby support.
Re:Ctrl-P for Vim: Pure Vimscript Command-T by mrinterweb on Tuesday May 01, 2012 @02:15PM (#3915669)
In the projects I have worked on, Ctrl-P seems faster than Command-T, but it's matching results are far from a replacement for Command-T. Ctrl-P often will not find files even when I type out the full file name. Command-T's match results are great. Ctrl-P will also show results from hidden/ignored directories. When Ctrl-P is smarter about its match results, I will use it more frequently.
Re:Ctrl-P for Vim: Pure Vimscript Command-T by Oompa on Monday April 30, 2012 @02:07PM (#3910466)
The overall comparison ends up being: Command-T is more of a pain to get setup, but is faster. CtrlP is easier to get setup, but is slower.
Re:Ctrl-P for Vim: Pure Vimscript Command-T by idank on Monday April 30, 2012 @12:12PM (#3909829)
I'm also interested in knowing how fast this is with huge directory trees.

I remember in early versions of Command-T, the Ruby implementation was slow for big trees. They rewrote some of it later in C.

Re:Ctrl-P for Vim: Pure Vimscript Command-T by derwiki on Monday April 30, 2012 @12:38PM (#3909975)
I just overheard Wincent say that Command-T was always written in C because previous Ruby plugins that attempted to accomplish the same thing was too slow. Command-T was written to be instant.
Re:Ctrl-P for Vim: Pure Vimscript Command-T by lloeki on Monday April 30, 2012 @12:51PM (#3910051)
FWIW I ran

    cd
    vim
    <Ctrl+P>
    (wait 10~15s for it to complete)
    <ESC>
    :q
    find . |wc -l
    183239
Fast enough for me. (MacBookPro5,5 + aftermarket Samsung 470 SSD)

Command-T is faster for sure. But it lacks critical features that Ctrl-P has (no vim -ruby dependency for one).

Re:Ctrl-P for Vim: Pure Vimscript Command-T by notJim on Tuesday May 01, 2012 @12:46AM (#3913030)
When you start vim again and hit ctrl+p, does it do all that over again?
Re:Ctrl-P for Vim: Pure Vimscript Command-T by lloeki on Tuesday May 01, 2012 @04:27AM (#3913471)
If I don't quit vim, and do Ctrl+P, things got cached (which you force-refresh with F5) so it's instant.

If I quit and restart vim, the Ctrl-P cache is invalidated thus it's scanning again, but it's down to 3~5s since disk reads got cached by the OS.

Re:Ctrl-P for Vim: Pure Vimscript Command-T by westcave on Friday May 04, 2012 @02:32PM (#3929690)
Yes. But you can specify a local cache file if you want... in which case it would not start over when you restart.
Re:Ctrl-P for Vim: Pure Vimscript Command-T by notJim on Saturday May 05, 2012 @02:40PM (#3932849)
Ah, I see. I added a similar feature to Command-T, because scanning one of my projects trees takes a couple seconds.