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") -