Revert "Migrate from the silver searcher to ripgrep"

This commit is contained in:
Yan Pritzker
2017-05-30 16:40:31 -05:00
committed by GitHub
parent a8f11c97c6
commit e5a1358508
8 changed files with 17 additions and 27 deletions

View File

@@ -1,16 +1,10 @@
if exists("g:ctrlp_user_command")
unlet g:ctrlp_user_command
endif
if executable('rg')
" Use rg in CtrlP for listing files. Lightning fast and respects .gitignore
let g:ctrlp_user_command = 'rg --files --smart-case %s'
" rg is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0
elseif executable('ag')
if 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$"'
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

View File

@@ -1,4 +1,3 @@
"Use RipGrep for lightning fast Gsearch command
set grepprg=rg\ --vimgrep\ --no-heading
set grepformat=%f:%l:%c:%m,%f:%l:%m
"Use the silver searcher for lightning fast Gsearch command
set grepprg=git\ grep
let g:grep_cmd_opts = '--line-number'

View File

@@ -1,3 +0,0 @@
" Open the Rg command and place the cursor into the quotes
nmap ,rg :Rg ""<Left>
nmap ,rf :Rg --files ""<Left>

View File

@@ -11,20 +11,20 @@ function! GetVisual()
endfunction
"grep the current word using ,k (mnemonic Kurrent)
nnoremap <silent> ,k :Rg <cword><CR>
nnoremap <silent> ,k :Ag <cword><CR>
"grep visual selection
vnoremap ,k :<C-U>execute "Rg " . GetVisual()<CR>
vnoremap ,k :<C-U>execute "Ag " . GetVisual()<CR>
"grep current word up to the next exclamation point using ,K
nnoremap ,K viwf!:<C-U>execute "Rg " . GetVisual()<CR>
nnoremap ,K viwf!:<C-U>execute "Ag " . GetVisual()<CR>
"grep for 'def foo'
nnoremap <silent> ,gd :Rg 'def <cword>'<CR>
nnoremap <silent> ,gd :Ag 'def <cword>'<CR>
",gg = Grep! - using Rg RipGrep
",gg = Grep! - using Ag the silver searcher
" open up a grep line, with a quote started for the search
nnoremap ,gg :Rg ""<left>
nnoremap ,gg :Ag ""<left>
"Grep for usages of the current file
nnoremap ,gcf :exec "Rg " . expand("%:t:r")<CR>
nnoremap ,gcf :exec "Ag " . expand("%:t:r")<CR>

View File

@@ -1,5 +1,5 @@
Bundle "justinmk/vim-sneak"
Bundle "jremmen/vim-ripgrep"
Bundle "rking/ag.vim"
Bundle "henrik/vim-indexed-search"
Bundle "nelstrom/vim-visual-star-search"
Bundle "skwp/greplace.vim"