1

In ~/.vimrc , I've set:

" Configure CtrlP

" Ctrl-O opens CtrlP for the current word.
map <C-o> <C-P><C-\>w

" Ensure we aren't using a custom command.
if exists("g:ctrl_user_command")
  unlet g:ctrlp_user_command
endif

" Specify the cache directory.
let g:ctrlp_cache_dir = $HOME . '/.cache/ctrlp'

" Ignore certain files and directories.
let g:ctrlp_custom_ignore = {
  \ 'dir':  '\v(\.git|\.hg|\.svn\|vendor|tmp)$',
  \ 'file': '\v\.(swp|swo)$',
  \ 'link': '',
  \ }

" Disable opening files in a new buffer ("e").
" Default to opening files in a new tab ("t").
let g:ctrlp_prompt_mappings = {
    \ 'AcceptSelection("e")': [],
    \ 'AcceptSelection("t")': ['<cr>', '<2-LeftMouse>'],
    \ }

However, CtrlP continues to index files in vendor/ :

$ grep -c '^vendor/' ~/.cache/ctrlp/%Users%nick%src%todo.txt
11759

If I remove g:ctrlp_custom_ignore and add this:

set wildignore+=*/tmp/*,*.so,*.swp,*.swo,*/vendor/*,*/\.git/*

CtrlP does not index files in vendor/ . Why is CtrlP not using g:ctrlp_custom_ignore ?


Related SO questions:

Community
  • 1
  • 1
nickh
  • 4,721
  • 2
  • 29
  • 31
  • If you need to speed up indexing of CtrlP, you can use ag to grep files (see my answer [here](http://stackoverflow.com/questions/32516838/how-to-run-call-ctrlp-first-time-in-the-background-vim/32520039#32520039)). Also it can help you with [ignoring files and directories correctly](https://github.com/ggreer/the_silver_searcher/blob/master/doc/ag.1.md). – ryuichiro Nov 11 '15 at 21:45
  • Thanks @ryuichiro. I switched to ag and all's good. – nickh Nov 12 '15 at 04:04

0 Answers0