From 8ee7450812a97f126958e47cbe84db58887ac4d5 Mon Sep 17 00:00:00 2001 From: Ingo Karkat Date: Mon, 26 Nov 2012 11:24:10 +0100 Subject: [PATCH] Allow customizing all mappings f1d0fbbdf4d77b73ba47146bada375223b3d733a allowed customizing the . mapping by making the implementation function publicly accessible. Let's do the same to s:wrap(), so that the other mappings (u, U, ) can be extended, too. (Personally, I'd like to have undo / redo stop and beep at the last saved position, to avoid that I accidentally undo beyond the saved state even though I didn't intend to.) --- autoload/repeat.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/autoload/repeat.vim b/autoload/repeat.vim index 71cee99..dbbae7d 100644 --- a/autoload/repeat.vim +++ b/autoload/repeat.vim @@ -91,7 +91,7 @@ function! repeat#run(count) endif endfunction -function! s:wrap(command,count) +function! repeat#wrap(command,count) let preserve = (g:repeat_tick == b:changedtick) exe 'norm! '.(a:count ? a:count : '').a:command . (&foldopen =~# 'undo' ? 'zv' : '') if preserve @@ -100,11 +100,11 @@ function! s:wrap(command,count) endfunction nnoremap . :call repeat#run(v:count) -nnoremap u :call wrap('u',v:count) +nnoremap u :call repeat#wrap('u',v:count) if maparg('U','n') ==# '' - nnoremap U :call wrap('U',v:count) + nnoremap U :call repeat#wrap('U',v:count) endif -nnoremap :call wrap("\C-R>",v:count) +nnoremap :call repeat#wrap("\C-R>",v:count) augroup repeatPlugin autocmd!