vim/plugin/grep-operator.vim @ a71a9f4b59fd
sjl/dotfiles turns 1000 let's celebrate with a README
| author | Steve Losh <steve@stevelosh.com> |
|---|---|
| date | Mon, 24 Feb 2014 12:41:26 -0500 |
| parents | 7f2c706a6945 |
| children | (none) |
nnoremap <leader>g :set operatorfunc=<SID>GrepOperator<cr>g@ vnoremap <leader>g :<C-U>call <SID>GrepOperator(visualmode())<cr> function! s:GrepOperator(type) let saved_unnamed_register = @@ if a:type ==# 'v' normal! `<v`>y elseif a:type ==# 'char' normal! `[v`]y else return endif silent execute "grep! -R " . shellescape(@@) . " ." copen let @@ = saved_unnamed_register endfunction