vim/plugin/grep-operator.vim @ 5e93682ea728
train my stupid fuckin brain to touch the yubikey
| author | Steve Losh <steve@stevelosh.com> |
|---|---|
| date | Tue, 24 Jul 2018 00:37:36 +0000 |
| 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