wincent / command-t

⌨️ Fast file navigation for Neovim and Vim
BSD 2-Clause "Simplified" License
2.74k stars 317 forks source link

Caching is not happening command-t #383

Closed dcDeba closed 1 year ago

dcDeba commented 2 years ago

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.?

wincent commented 2 years ago

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.

dcDeba commented 2 years ago

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

wincent commented 2 years ago

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.

dcDeba commented 2 years ago

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.

wincent commented 2 years ago

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

dcDeba commented 2 years ago

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

wincent commented 2 years ago

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 commented 1 year ago

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:

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