0

I installed ctrlp, but it takes 3 seconds to open a file after I stroke CTRL-T or Enter in ctrlp.

Here is my config:

let g:ctrlp_working_path_mode = 0
set wildignore+=*/tmp/*,*.swp,*.class
let g:ctrlp_custom_ignore = '\v[\/]\.(git|class)$'

let g:ctrlp_cache_dir = $HOME.'/.vim/ctrlp'
let g:ctrlp_clear_cache_on_exit = 0
" autosave and autoload session
let g:session_autosave = 'yes'
let g:session_autoload = 'yes'

What is wrong?

Sato
  • 8,192
  • 17
  • 60
  • 115

1 Answers1

0

A pretty neat trick to speed up CtrlP is to install ag(https://github.com/ggreer/the_silver_searcher), which can be configured by:

"Use The Silver Searcher https://github.com/ggreer/the_silver_searcher
if executable('ag')
    set grepprg=ag\ --nogroup\ --nocolor
    let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
    let g:ctrlp_use_caching = 0
    " ag is fast enough that you can disable caching.
endif

If CtrlP is slow after finding the file, however, I'd recommend disabling caching. It could be taking a while because it has to update your cache, which you've configured not to be cleared.

Paul Bae
  • 60
  • 1
  • 6