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 . command TagsUpdate !ctags -R .
" Set grepprg " Set grepprg
if executable("rg") if executable('rg')
set grepprg=rg\ --vimgrep\ --no-heading set grepprg=rg\ --vimgrep\ --no-heading\ --color=never
set grepformat=%f:%l:%c:%m,%f:%l:%m set grepformat=%f:%l:%c:%m,%f:%l:%m
elseif executable('ag') elseif executable('ag')
set grepprg=ag\ --vimgrep\ --nogroup\ --nocolor set grepprg=ag\ --vimgrep\ --nogroup\ --nocolor

View File

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