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