configured ag & Ag commands
This commit is contained in:
parent
ca8ca4c021
commit
f15c41f7ad
1 changed files with 21 additions and 0 deletions
|
@ -126,3 +126,24 @@ nnoremap <silent> <leader>z :Goyo<cr>
|
||||||
" => Syntastic (syntax checker)
|
" => Syntastic (syntax checker)
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
let g:syntastic_python_checkers=['pyflakes']
|
let g:syntastic_python_checkers=['pyflakes']
|
||||||
|
|
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
" => vim-ag aka The Silver Searcher
|
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
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
|
||||||
|
|
||||||
|
" bind K to grep word under cursor
|
||||||
|
nnoremap K :grep! "\b<C-R><C-W>\b"<CR>:cw<CR>
|
||||||
|
|
||||||
|
" bind \ (backward slash) to grep shortcut
|
||||||
|
command -nargs=+ -complete=file -bar Ag silent! grep! <args>|cwindow|redraw!
|
||||||
|
nnoremap \ :Ag<SPACE>
|
||||||
|
|
Loading…
Reference in a new issue