hk_bwg
Last Updated: February 25, 2016
·
7.394K
· av-ast
C24ce8d41d4134d3d616fbd486162c38

How to speed up CtrlP

CtrlP is an amazing vim plugin for fuzzy search but it starts to slow down for a fairly large projects.
In order to speed up your CtrlP you can exclude some folders and files from indexing in this way:

Put these lines into your .vimrc:

" Ignore some folders and files for CtrlP indexing
let g:ctrlp_custom_ignore = {
  \ 'dir':  '\.git$\|\.yardoc\|public$|log\|tmp$',
  \ 'file': '\.so$\|\.dat$|\.DS_Store$'
  \ }

Here is a link to my gist.

Say Thanks
Respond

4 Responses
Add your response

8808
D83b63db79b42978fe35e120550ca180

In fact, you could go even further and use ag to grep files (it is faster than find)

" Use The Silver Searcher https://github.com/ggreer/the_silver_searcher
if executable('ag')
  " Use Ag over Grep
  set grepprg=ag\ --nogroup\ --nocolor

  " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
  let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
endif

Credits: Thoughtbot dotfiles

over 1 year ago ·
8810
C24ce8d41d4134d3d616fbd486162c38

akalyaev thanks for your notice! I'll give it a try.

over 1 year ago ·
9923

Note that there are some files you might want to open, like db/structure.sql, which ag ignores.

over 1 year ago ·
15829
Dfbe6b2c8b7f2b7549a106af247c6e52

Complementing: ctrpl also ignores files specified via wildignore.

over 1 year ago ·
Filed Under