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

Caching is not happening command-t

Open dcDeba opened this issue 4 years ago • 7 comments

Every time I try to open command-t on a file, it starts searching for all the files making the vim unusable. How to cache the result and use the same cache in multiple files.?

dcDeba avatar Oct 04 '21 11:10 dcDeba

Do you have 'autochdir' set, by any chance? (See :h 'autochdir'). That setting causes Vim to change directory every time you open a file, which causes Command-T to have to re-scan from the new "root" directory.

See also :h g:CommandTMaxCachedDirectories, which lets you choose how many directories get cached.

wincent avatar Oct 04 '21 12:10 wincent

I checked if autochdir is set or not using the below command: command--> :verbose set autochdir? Output--> noautochdir

I have set g:CommandTMaxCachedDirectories to the following in .vimrc

let g:CommandTMaxCachedDirectories=0

dcDeba avatar Oct 04 '21 12:10 dcDeba

Must be something else going on then. This is with the standard :CommandT finder, right?

Can you confirm that :pwd is stable and not changing?

There might be something unknown to me in your local environment that is causing Command-T to drop its cache; there isn't anything internal to the plug-in itself that would do that, other than the things I just said.

wincent avatar Oct 04 '21 12:10 wincent

Yes, with standard :CommandT finder.

I have opened the same file twice and checked the output of :pwd and its same.

Is there any way to specify the cache path?

Also, what is the name of the cache file and in which directory is it created.

dcDeba avatar Oct 04 '21 13:10 dcDeba

It's not a file; it's an in-memory cache — as in, if you quit Vim, the cache is gone.

wincent avatar Oct 04 '21 13:10 wincent

Okay! Is there any way I can debug the issue?

dcDeba avatar Oct 04 '21 13:10 dcDeba

You could try disabling all other plugins and starting with an empty .vimrc; like I said above, there's nothing internal to Command-T that would cause it to rescan a cached directory.

wincent avatar Oct 04 '21 13:10 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