mirror of
https://github.com/ViViDboarder/vim-settings.git
synced 2024-12-22 18:07:34 +00:00
Add rg to ctrlp configs
This commit is contained in:
parent
2a07143e43
commit
62c65e5d73
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user