diff --git a/autoload/repeat.vim b/autoload/repeat.vim index 18b1280..0f4f831 100644 --- a/autoload/repeat.vim +++ b/autoload/repeat.vim @@ -52,6 +52,23 @@ let g:loaded_repeat = 1 let g:repeat_tick = -1 let g:repeat_reg = ['', ''] +if !exists('g:repeat_map_dot') + let g:repeat_map_dot = '.' +endif +if !exists('g:repeat_map_u') + let g:repeat_map_u = 'u' +endif +if !exists('g:repeat_map_U') + if maparg('U','n') ==# '' + let g:repeat_map_U = 'U' + else + let g:repeat_map_U = '' + endif +endif +if !exists('g:repeat_map_C_R') + let g:repeat_map_C_R = '' +endif + " Special function to avoid spurious repeats in a related, naturally repeating " mapping when your repeatable mapping doesn't increase b:changedtick. function! repeat#invalidate() @@ -103,12 +120,18 @@ 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) +if len(g:repeat_map_dot) + exe 'nnoremap '.g:repeat_map_dot.' :call repeat#run(v:count)' +endif +if len(g:repeat_map_u) + exe 'nnoremap '.g:repeat_map_u.' :call repeat#wrap("u",v:count)' +endif +if len(g:repeat_map_U) + exe 'nnoremap '.g:repeat_map_U.' :call repeat#wrap("U",v:count)' +endif +if len(g:repeat_map_u) + exe 'nnoremap '.g:repeat_map_C_R.' :call repeat#wrap("\C-R>",v:count)' endif -nnoremap :call repeat#wrap("\C-R>",v:count) augroup repeatPlugin autocmd!