How to run/call CtrlP first time in the background - VIM

后端 未结 2 1324
青春惊慌失措
青春惊慌失措 2021-01-24 05:52

When calling CtrlP for the first time it cause quite a delay to build the cache. Is there a way to run it in the background so I can continue doing stuff in vim

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-24 06:36

    If you need to speed up indexing of CtrlP, you can use ag to grep files, exclude some folders and files from indexing, and set cache location.

    To do that, put these lines in your .vimrc:

    let g:ctrlp_cache_dir = $HOME . '/.cache/ctrlp'
    let g:ctrlp_user_command = 'ag %s -i --nocolor --nogroup --hidden
      \ --ignore .git
      \ --ignore .svn
      \ --ignore .hg
      \ --ignore .DS_Store
      \ --ignore "**/*.pyc"
      \ -g ""'
    

提交回复
热议问题