From 4a53d320243437ca02d7609aefad5b4c603514df Mon Sep 17 00:00:00 2001 From: ManjaroOne666 Date: Wed, 27 Dec 2017 13:15:57 +0000 Subject: [PATCH] use ag for searching --- vimrc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/vimrc b/vimrc index 07605cd..4009968 100644 --- a/vimrc +++ b/vimrc @@ -169,6 +169,9 @@ nnoremap qfh :chistory nnoremap qfp :colder nnoremap qfn :cnewer +" quick grep of visual selection +vnoremap gr y:grep! -R " . + " brace/quotes completion inoremap {{ {} inoremap {{{ {}O @@ -286,6 +289,17 @@ augroup END set undodir=/home/ray/.vim/undodir set undofile +" Use the silver searcher ag command instead of grep +if executable('ag') + " Use ag over grep + set grepprg=ag\ --nogroup\ --nocolor + + " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore + let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""' + + " ag is fast enough that CtrlP doesn't need to cache + let g:ctrlp_use_caching = 0 +endif " Functions