diff --git a/autoload/repeat.vim b/autoload/repeat.vim index cb5e895..cd305a7 100644 --- a/autoload/repeat.vim +++ b/autoload/repeat.vim @@ -112,12 +112,17 @@ function! repeat#wrap(command,count) endif endfunction -nnoremap . :call repeat#run(v:count) -nnoremap u :call repeat#wrap('u',v:count) -if maparg('U','n') ==# '' - nnoremap U :call repeat#wrap('U',v:count) +nnoremap (RepeatDot) :call repeat#run(v:count) +nnoremap (RepeatUndo) :call repeat#wrap('u',v:count) +nnoremap (RepeatUndoLine) :call repeat#wrap('U',v:count) +nnoremap (RepeatRedo) :call repeat#wrap("\C-R>",v:count) + +if !hasmapto('(RepeatDot)', 'n') | nmap . (RepeatDot) | endif +if !hasmapto('(RepeatUndo)', 'n') | nmap u (RepeatUndo) | endif +if maparg('U','n') ==# '' && !hasmapto('(RepeatUndoLine)', 'n') + nmap U (RepeatUndoLine) endif -nnoremap :call repeat#wrap("\C-R>",v:count) +if !hasmapto('(RepeatRedo)', 'n') | nmap (RepeatRedo) | endif augroup repeatPlugin autocmd!