From b9a8bb5f7c13cf193d7b254f14243fbc1354c334 Mon Sep 17 00:00:00 2001 From: Luiz Gonzaga dos Santos Filho Date: Tue, 29 Apr 2014 18:30:25 -0300 Subject: [PATCH] Fix Ag functions I believe this is what is intended? It was not working for me like it was... --- vim/settings/search.vim | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/vim/settings/search.vim b/vim/settings/search.vim index 74947e5..6e0a147 100644 --- a/vim/settings/search.vim +++ b/vim/settings/search.vim @@ -10,14 +10,14 @@ function! GetVisual() return selection endfunction -"git grep the current word using K (mnemonic Kurrent) +"grep the current word using K (mnemonic Kurrent) nnoremap K :Ag -"git grep visual selection -vnoremap K :execute Ag(GetVisual()) +"grep visual selection +vnoremap K :execute "Ag " . GetVisual() -"git grep current word up to the next exclamation point using ,K -nnoremap ,K viwf!:execute Ag(GetVisual()) +"grep current word up to the next exclamation point using ,K +nnoremap ,K viwf!:execute "Ag " . GetVisual() "grep for 'def foo' nnoremap ,gd :Ag 'def ' @@ -27,7 +27,7 @@ nnoremap ,gd :Ag 'def ' nnoremap ,gg :Ag "" "Grep Current Partial -function! AgCurrentPartial() +function! AgCurrentPartial() let l:fileNameWithoutExtension = expand('%:t:r') let l:fileNameWithoutUnderscore = substitute(l:fileNameWithoutExtension, '^_','','g') let l:grepPattern = "render.*[\\\'\\\"].*" . l:fileNameWithoutUnderscore . "[\\\'\\\"]$" @@ -40,4 +40,3 @@ nnoremap ,gcp :AgCurrentPartial "Grep for usages of the current file nnoremap ,gcf :exec "Ag " . expand("%:t:r") -