Here are a few tips that should definitely speed up ctrlp :
let g:ctrlp_cache_dir = $HOME . '/.cache/ctrlp'
if executable('ag')
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
endif
In the above example, the first option tells ctrlp to persist the cache in the configured location, so when you launch vim again, it will read from there and load the cache (much faster).
The second option configures ctrlp to use ag (the_silver_searcher) instead of vim’s native globpath()
apis to search for files, this will drastically improve it’s scanning speed, if you don’t want to use ag
, you can even use plain old grep
and it still should be significantly faster. Check :h 'g:ctrlp_user_command'
for more details.