Fallback to ag if rg is not present

This commit is contained in:
Steven Barragan
2017-05-23 15:15:04 -07:00
committed by Steven Barragán
parent a3c7492f82
commit f9519dc9f0

View File

@@ -8,6 +8,12 @@ if executable('rg')
" rg is fast enough that CtrlP doesn't need to cache " rg is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0 let g:ctrlp_use_caching = 0
elseif executable('ag')
" Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
let g:ctrlp_user_command = 'ag %s --files-with-matches -g "" --ignore "\.git$\|\.hg$\|\.svn$"'
" ag is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0
else else
" Fall back to using git ls-files if Ag is not available " Fall back to using git ls-files if Ag is not available
let g:ctrlp_custom_ignore = '\.git$\|\.hg$\|\.svn$' let g:ctrlp_custom_ignore = '\.git$\|\.hg$\|\.svn$'