diff --git a/.vimrc b/.vimrc --- a/.vimrc +++ b/.vimrc @@ -30,7 +30,6 @@ let s:filename = expand('') Plug 'Shougo/unite-session' Plug 'sjl/gundo.vim', {'on': 'GundoToggle'} Plug 'majutsushi/tagbar', {'on': 'TagbarToggle'} - Plug 'rking/ag.vim' Plug 'godlygeek/tabular' Plug 'tomtom/tcomment_vim' @@ -124,6 +123,9 @@ command! Gcd call vimrc#Gcd() command! Hgcd call vimrc#Hgcd() command! SyntaxCompleteOn setl omnifunc=syntaxcomplete#Complete +command! -nargs=+ -complete=file -bar Ag sil! gr |cope|redr!|let @/=""|set hls +CAlias Rg Ag + CAlias Q q CAlias Qa qa CAlias W w @@ -226,6 +228,14 @@ if has('persistent_undo') let &undodir = g:vimcache . '/undo//,.' endif +if executable('rg') + set grepprg=rg\ --vimgrep\ --no-heading + set grepformat=%f:%l:%c:%m,%f:%l%m,%f\ \ %l%m +elseif executable('ag') + set grepprg=ag\ --nogroup\ --nocolor\ --vimgrep + set grepformat^=%f:%l:%c:%m +endif + if g:on_windows set guifont=DejaVu_Sans_Mono:h10:cDEFAULT set linespace=0