search.vim 725 B

123456789101112131415161718
  1. " use faster search tools if available
  2. if executable('rg')
  3. set grepprg=rg\ --vimgrep
  4. elseif executable('ag')
  5. set grepprg=ag\ --vimgrep\ $*
  6. set grepformat=%f:%l:%c:%m
  7. elseif executable('ack')
  8. set grepprg=ack\ --with-filename\ --nocolor\ --nogroup\ --column
  9. elseif executable('ack-grep')
  10. set grepprg=ack-grep\ --with-filename\ --nocolor\ --nogroup\ --column
  11. endif
  12. " EasyGrep settings.
  13. let g:EasyGrepCommand = 1 " Default to grepprg instead of vimgrep.
  14. let g:EasyGrepRecursive = 1
  15. let g:EasyGrepReplaceWindowMode = 2 " Replace in same window, not tabs/splits
  16. let g:EasyGrepFilesToExclude=".git" " Exclude dirs for `ack` and `grep`
  17. let g:EasyGrepRoot = "search:.git,.hg,.svn" " Repo-aware when possible.