Skip to content

Commit

Permalink
make wordwise \* use vimgrep instead of grep -r
Browse files Browse the repository at this point in the history
  • Loading branch information
bronson committed Aug 14, 2010
1 parent 7c71bf2 commit ab4e844
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions plugin/visual-star-search.vim
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ endfunction
vmap * :<C-u>call <SID>VSetSearch()<CR>//<CR>
vmap # :<C-u>call <SID>VSetSearch()<CR>??<CR>
" recursively vimgrep if you hit leader-star
nmap <leader>* :execute "noautocmd grep -rw " . expand("<cword>") . " ."<CR>
vmap <leader>* :<C-u>call <SID>VSetSearch()<CR>:execute "noautocmd vimgrep /" . @/ . "/ **"<CR>
" recursively vimgrep for word under cursor or selection if you hit leader-star
nmap <leader>* :execute 'noautocmd vimgrep /\V' . substitute(escape(expand("<cword>"), '\'), '\n', '\\n', 'g') . '/ **'<CR>
vmap <leader>* :<C-u>call <SID>VSetSearch()<CR>:execute 'noautocmd vimgrep /' . @/ . '/ **'<CR>

0 comments on commit ab4e844

Please sign in to comment.