easygrep.vim 781 B

12345678910111213141516171819
  1. " use faster search tools if available
  2. if executable('ag')
  3. set grepprg=ag\ --vimgrep\ $*
  4. set grepformat=%f:%l:%c:%m
  5. elseif executable('ack')
  6. set grepprg=ack\ --with-filename\ --nocolor\ --nogroup\ --column
  7. elseif executable('ack-grep')
  8. set grepprg=ack-grep\ --with-filename\ --nocolor\ --nogroup\ --column
  9. endif
  10. " don't display ack/grep terminal output. NOTE: not reliable
  11. " https://github.com/mileszs/ack.vim/issues/18
  12. "set shellpipe=&>
  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.