command-t icon indicating copy to clipboard operation
command-t copied to clipboard

caching candidate file-names is doable?

Open godhelpjun opened this issue 9 years ago • 3 comments

As I said before,command-t is a great plug-in,I love it,use it every work day. This is my situation:I open a group of files : a.php,b.php... get some things done. close vim to keep my work desk clean. then I open another group of files : c.php,d.php with another vim session. on my project's directory.it's about 15k files in that hierarchies. every session initials candidate file names costs me 5-10 seconds.my project is stable.rarely added or removed too much files. So,I was wondering,can we just create a files list,i.e : find >fileslist.txt ,and then we set some switches like : let g:CommandTCandidateFile='filelist.txt' ,then we just search names in the file fileslist.txt to get the matching result? Or,add some switches some thing like let g:CommandTShareCaching='true' to share caches between the vim sessions ? Finally,I'm not sure if I can get the 'watchman' works properly in my cygwin... Best regards.Love you.

godhelpjun avatar Sep 14 '16 16:09 godhelpjun

If it's costing 5-10 seconds, you should consider using the Watchman scanner, although like you said, whether it works on cygwin is not really known. There is some Windows support.

Watchman should bring that time down to less than a second (potentially close to zero seconds). I think making that work would be preferable to adding a caching feature. (Another thing about caching: when caches get stale they can be annoying; see #238 for how we might avoid staleness when using Watchman.)

wincent avatar Sep 14 '16 16:09 wincent

Thanks to your information.Maybe I could try watchman in cygwin,but I can't see the chances.In general,I don't think watchman is friendly to all windows users.so watchman on windows seems not a good idea. Love you.

godhelpjun avatar Sep 14 '16 17:09 godhelpjun

I think getting Watchman working is a strictly superior solution because it allows you to have speed and avoid any problems with cache staleness. Adding caching would introduce internal complexity, and while it would help the slowness problem, it would bring with it a new set of problems (staleness).

So it's not something that I personally would be motivated to work on, but I've added the "wishlist" label to this issue. If somebody wants to take a stab at implementing this in a PR in a clean way that makes the cost of the additional internal complexity manageable, then I'd be happy to review it.

wincent avatar Sep 14 '16 18:09 wincent

Given the big rewrite for v6.0.x, I'm closing all older issues as there is unlikely to be anything significant happening on the 5-x-devel branch from here on[^patches]. Feedback issue for 6.0.x is here:

  • https://github.com/wincent/command-t/issues/393

[^patches]: Patches and PRs would be welcome, but my personal efforts are going to be directed towards main.

wincent avatar Aug 26 '22 21:08 wincent