From cffb2e7578c10da5e89bb1164caba06f96f4989b Mon Sep 17 00:00:00 2001 From: Konfekt Date: Fri, 20 Feb 2015 21:14:38 +0100 Subject: [PATCH] more convenient remapping by using mappings Now mappings can be remapped in `.vimrc` by `nnoremap (RepeatUndoLine)` and disablabled in `.vimrc` by `nnoremap (DisableRepeatUndoLine) (RepeatUndoLine)` --- autoload/repeat.vim | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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!