use ag for searching

This commit is contained in:
ManjaroOne666 2017-12-27 13:15:57 +00:00
parent 48fc2befdb
commit 4a53d32024
1 changed files with 14 additions and 0 deletions

14
vimrc
View File

@ -169,6 +169,9 @@ nnoremap <leader>qfh :chistory<CR>
nnoremap <leader>qfp :colder<CR> nnoremap <leader>qfp :colder<CR>
nnoremap <leader>qfn :cnewer<CR> nnoremap <leader>qfn :cnewer<CR>
" quick grep of visual selection
vnoremap <leader>gr y:grep! -R <C-r>" .
" brace/quotes completion " brace/quotes completion
inoremap {{ {}<left> inoremap {{ {}<left>
inoremap {{{ {<CR>}<esc>O inoremap {{{ {<CR>}<esc>O
@ -286,6 +289,17 @@ augroup END
set undodir=/home/ray/.vim/undodir set undodir=/home/ray/.vim/undodir
set undofile 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 " Functions