From f9519dc9f02fd8709bb63031acc8bb29e5162da1 Mon Sep 17 00:00:00 2001 From: Steven Barragan Date: Tue, 23 May 2017 15:15:04 -0700 Subject: [PATCH] Fallback to ag if rg is not present --- vim/settings/ctrlp.vim | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vim/settings/ctrlp.vim b/vim/settings/ctrlp.vim index a6ff442f..5d762740 100644 --- a/vim/settings/ctrlp.vim +++ b/vim/settings/ctrlp.vim @@ -8,6 +8,12 @@ if executable('rg') " rg is fast enough that CtrlP doesn't need to cache 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 " Fall back to using git ls-files if Ag is not available let g:ctrlp_custom_ignore = '\.git$\|\.hg$\|\.svn$'