1
0
Fork 0
mirror of synced 2024-12-25 08:13:20 -05:00

configured ag & Ag commands

This commit is contained in:
Mirosław Pragłowski 2014-07-30 11:55:07 +02:00
parent ca8ca4c021
commit f15c41f7ad

View file

@ -126,3 +126,24 @@ nnoremap <silent> <leader>z :Goyo<cr>
" => Syntastic (syntax checker)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
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>