This is a small vim plugin. grep in vim.
Grep asynchronously using the job
of vim.
This plugin will use grepprg
to grep.
Set up grepprg
in your vimrc with the following statement.
" use git grep.
set grepprg=git\ grep\ -I\ --line-number
" Or use ripgrep.
if executable('rg')
let &grepprg = 'rg --vimgrep --hidden'
set grepformat=%f:%l:%c:%m,%f:%l:%m
endif
" write in vimrc
nmap <Leader>a <Plug>(agrep-input)
Run
:Agrep foo
:Agrep foo bar "bar is the directory to search
:AgrepStop