Add rg to ctrlp configs

This commit is contained in:
ViViDboarder 2019-10-21 15:58:04 -07:00
parent 2a07143e43
commit 62c65e5d73
2 changed files with 8 additions and 6 deletions

View File

@ -129,8 +129,8 @@ command Todo grep TODO
command TagsUpdate !ctags -R .
" Set grepprg
if executable("rg")
set grepprg=rg\ --vimgrep\ --no-heading
if executable('rg')
set grepprg=rg\ --vimgrep\ --no-heading\ --color=never
set grepformat=%f:%l:%c:%m,%f:%l:%m
elseif executable('ag')
set grepprg=ag\ --vimgrep\ --nogroup\ --nocolor

View File

@ -41,11 +41,13 @@ nnoremap <leader>t :CtrlPBufTag<CR>
nnoremap <leader>u :CtrlPCurFile<CR>
nnoremap <silent> <F2> :CtrlPBuffer<CR>
" Special stuff for The Silver Searcher
if executable('ag')
" use ag for CtrlP
" Use custom search command
if executable('rg')
let g:ctrlp_user_command['fallback'] = 'rg %s --files --color=never --glob ""'
" rg is fast enough we don't need cache
let g:ctrlp_use_caching = 0
elseif executable('ag')
let g:ctrlp_user_command['fallback'] = 'ag %s -l --depth 5 --nocolor --nogroup -g ""'
" ag is fast enough we don't need cache
let g:ctrlp_use_caching = 0
endif
" TODO: Add rg support