use ag for searching
This commit is contained in:
parent
48fc2befdb
commit
4a53d32024
14
vimrc
14
vimrc
|
@ -169,6 +169,9 @@ nnoremap <leader>qfh :chistory<CR>
|
|||
nnoremap <leader>qfp :colder<CR>
|
||||
nnoremap <leader>qfn :cnewer<CR>
|
||||
|
||||
" quick grep of visual selection
|
||||
vnoremap <leader>gr y:grep! -R <C-r>" .
|
||||
|
||||
" brace/quotes completion
|
||||
inoremap {{ {}<left>
|
||||
inoremap {{{ {<CR>}<esc>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
|
||||
|
|
Loading…
Reference in New Issue