Skip to content

Commit e51d8b7

Browse files
committed
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
1 parent c0717e7 commit e51d8b7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

vimrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ if executable('ag')
7272

7373
" ag is fast enough that CtrlP doesn't need to cache
7474
let g:ctrlp_use_caching = 0
75+
76+
if !exists(":Ag")
77+
command -nargs=+ -complete=file -bar Ag silent! grep! <args>|cwindow|redraw!
78+
nnoremap \ :Ag<SPACE>
79+
endif
7580
endif
7681

7782
" Make it obvious where 80 characters is

0 commit comments

Comments
 (0)