Add ag mappings in vim

https://robots.thoughtbot.com/faster-grepping-in-vim

- Create an `:Ag` command if none is defined.
- map `\` in normal mode to set up the command for an argument
This commit is contained in:
Geoff Harcourt 2016-07-22 13:17:32 -04:00
parent c0717e7bd7
commit e51d8b73f0

5
vimrc
View file

@ -72,6 +72,11 @@ if executable('ag')
" ag is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0
if !exists(":Ag")
command -nargs=+ -complete=file -bar Ag silent! grep! <args>|cwindow|redraw!
nnoremap \ :Ag<SPACE>
endif
endif
" Make it obvious where 80 characters is