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: