Permalink
Browse files

Hope it works

  • Loading branch information...
5long committed Oct 14, 2012
1 parent 507b8ee commit 83a1fbbf374910a27a7cc2836a83aab2fc4344e6
Showing with 14 additions and 0 deletions.
  1. +14 −0 plugin/ryve.vim
View
@@ -15,12 +15,22 @@ function! s:ReplaceByMotion(type, ...)
silent normal! `[v`]p
endfunction
+function! s:ReplaceByMotionLine(type, ...)
+ silent normal! Vp
+endfunction
+
function! s:PasteByMotion(type, ...)
let saved_unnamed_reg = @@
call s:ReplaceByMotion(a:type)
let @@ = saved_unnamed_reg
endfunction
+function! s:PasteByMotionLine(type, ...)
+ let saved_unnamed_reg = @@
+ call s:ReplaceByMotionLine(a:type)
+ let @@ = saved_unnamed_reg
+endfunction
+
function! s:GoToName()
let pos = s:GoToPossibleAssignOp()
if pos == -1
@@ -55,7 +65,9 @@ endfunction
nnoremap <silent> <Plug>SearchByMotion :<c-u>set opfunc=<SID>SearchByMotion<CR>g@
nnoremap <silent> <Plug>ReplaceByMotion :<c-u>set opfunc=<SID>ReplaceByMotion<CR>g@
+nnoremap <silent> <Plug>ReplaceByMotionLine :<c-u>set opfunc=<SID>ReplaceByMotionLine<CR>g@
nnoremap <silent> <Plug>PasteByMotion :<c-u>set opfunc=<SID>PasteByMotion<CR>g@
+nnoremap <silent> <Plug>PasteByMotionLine :<c-u>set opfunc=<SID>PasteByMotionLine<CR>g@
nnoremap <silent> <Plug>GoToName :<c-u>call <SID>GoToName()<CR>
nnoremap <silent> <Plug>GoToValue :<c-u>call <SID>GoToValue()<CR>
@@ -65,10 +77,12 @@ endif
if !hasmapto('<Plug>ReplaceByMotion', 'n')
nmap <unique> gr <Plug>ReplaceByMotion
+ nmap <unique> grr <Plug>ReplaceByMotionLine
endif
if !hasmapto('<Plug>PasteByMotion', 'n')
nmap gp <Plug>PasteByMotion
+ nmap gpp <Plug>PasteByMotionLine
endif
if !hasmapto('<Plug>GoToName', 'n')

0 comments on commit 83a1fbb

Please sign in to comment.