Use the BufAdd autocommand to automatically add new files to the list
This should allow automatically finding new files created in the current vim session without needing a costly full rescan. Triggering on BufWritePost/FileWritePost/FileAppendPost may be a better route if you only want to get files that are actually written to disk.
Thanks for the suggestion, @RedBeard0351. This could be useful, although it would add some internal complexity, so the cost/benefit trade-off would need to be evaluated. One reason why I haven't pursued something like this in the past is that you can achieve something similar in user space by adding your own autocommand that just calls :CommandTFlush (no internal complexity, but may introduce a delay on repos with a lot of files, because you need to do a full scan on the next in vocation of Command -T).
Also see https://github.com/wincent/command-t/issues/238 which would take care of this for users of the "watchman" scanner without much generalized internal complexity (any complexity it introduces will be local to that scanner only).
Unfortunately due to a large number of filtered-out files (the build dir, git, third_party, etc) a full scan takes 2-3 seconds which is a but too high of a penalty for me.
I didn't realize that it would add a bunch of complexity. How hard would it be to add a command that is like the union of :CommandT and :CommandTBuffer? Now That I've typed it, I realize that would work better for me, especially if it always sorted open buffers first. I tend to use ,t as my all-purpose switch-to-file and files I've already opened are likely to be more relevant than ones I haven't. Should I open that as a separate ticket?
Related: a ticket for a "go to anything" feature: https://github.com/wincent/command-t/issues/102
As far as complexity goes, it would be useful to have a concrete implementation to discuss. In its absence I am just sharing my gut instinct that it would be a potential source of bugs.
One other thing: there is some work going on to move most of the work outside of the Vim process (see https://github.com/wincent/command-t/issues/220), which would make the blocking nature of a full rescan less of a problem.
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.