Fix Ag functions

I believe this is what is intended? It was not working for me like it was...
This commit is contained in:
Luiz Gonzaga dos Santos Filho
2014-04-29 18:30:25 -03:00
parent ed154c72ca
commit b9a8bb5f7c

View File

@@ -10,14 +10,14 @@ function! GetVisual()
return selection return selection
endfunction endfunction
"git grep the current word using K (mnemonic Kurrent) "grep the current word using K (mnemonic Kurrent)
nnoremap <silent> K :Ag <cword><CR> nnoremap <silent> K :Ag <cword><CR>
"git grep visual selection "grep visual selection
vnoremap K :<C-U>execute Ag(GetVisual())<CR> vnoremap K :<C-U>execute "Ag " . GetVisual()<CR>
"git grep current word up to the next exclamation point using ,K "grep current word up to the next exclamation point using ,K
nnoremap ,K viwf!:<C-U>execute Ag(GetVisual())<CR> nnoremap ,K viwf!:<C-U>execute "Ag " . GetVisual()<CR>
"grep for 'def foo' "grep for 'def foo'
nnoremap <silent> ,gd :Ag 'def <cword>'<CR> nnoremap <silent> ,gd :Ag 'def <cword>'<CR>
@@ -40,4 +40,3 @@ nnoremap ,gcp :AgCurrentPartial<CR>
"Grep for usages of the current file "Grep for usages of the current file
nnoremap ,gcf :exec "Ag " . expand("%:t:r")<CR> nnoremap ,gcf :exec "Ag " . expand("%:t:r")<CR>