From 5d8d8838df9c48eef7c9c8d04064bb3a9f990935 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sun, 21 Jul 2013 12:56:01 +0200 Subject: [PATCH] plugin/repeat.vim: Replace with Git submodule. Also update to version 1.1. --- .gitmodules | 3 ++ vim/bundle/repeat | 1 + vim/plugin/repeat.vim | 72 ------------------------------------------- 3 files changed, 4 insertions(+), 72 deletions(-) create mode 160000 vim/bundle/repeat delete mode 100644 vim/plugin/repeat.vim diff --git a/.gitmodules b/.gitmodules index c6d8925..cf747d9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,3 +13,6 @@ [submodule "vim/bundle/surround"] path = vim/bundle/surround url = https://github.com/tpope/vim-surround.git +[submodule "vim/bundle/repeat"] + path = vim/bundle/repeat + url = https://github.com/tpope/vim-repeat.git diff --git a/vim/bundle/repeat b/vim/bundle/repeat new file mode 160000 index 0000000..a81bef7 --- /dev/null +++ b/vim/bundle/repeat @@ -0,0 +1 @@ +Subproject commit a81bef76031ca1c71766b516417480caeb01c932 diff --git a/vim/plugin/repeat.vim b/vim/plugin/repeat.vim deleted file mode 100644 index e6ec409..0000000 --- a/vim/plugin/repeat.vim +++ /dev/null @@ -1,72 +0,0 @@ -" repeat.vim - Let the repeat command repeat plugin maps -" Maintainer: Tim Pope -" Version: 1.0 - -" Installation: -" Place in either ~/.vim/plugin/repeat.vim (to load at start up) or -" ~/.vim/autoload/repeat.vim (to load automatically as needed). -" -" Developers: -" Basic usage is as follows: -" -" silent! call repeat#set("\MappingToRepeatCommand",3) -" -" The first argument is the mapping that will be invoked when the |.| key is -" pressed. Typically, it will be the same as the mapping the user invoked. -" This sequence will be stuffed into the input queue literally. Thus you must -" encode special keys by prefixing them with a backslash inside double quotes. -" -" The second argument is the default count. This is the number that will be -" prefixed to the mapping if no explicit numeric argument was given. The -" value of the v:count variable is usually correct and it will be used if the -" second parameter is omitted. If your mapping doesn't accept a numeric -" argument and you never want to receive one, pass a value of -1. -" -" Make sure to call the repeat#set function _after_ making changes to the -" file. - -if exists("g:loaded_repeat") || &cp || v:version < 700 - finish -endif -let g:loaded_repeat = 1 - -let g:repeat_tick = -1 - -function! repeat#set(sequence,...) - silent exe "norm! \"=''\p" - let g:repeat_sequence = a:sequence - let g:repeat_count = a:0 ? a:1 : v:count - let g:repeat_tick = b:changedtick -endfunction - -function! s:repeat(count) - if g:repeat_tick == b:changedtick - let c = g:repeat_count - let s = g:repeat_sequence - let cnt = c == -1 ? "" : (a:count ? a:count : (c ? c : '')) - call feedkeys(cnt . s) - else - call feedkeys((a:count ? a:count : '') . '.', 'n') - endif -endfunction - -function! s:wrap(command,count) - let preserve = (g:repeat_tick == b:changedtick) - exe 'norm! '.(a:count ? a:count : '').a:command - if preserve - let g:repeat_tick = b:changedtick - endif -endfunction - -nnoremap . :call repeat(v:count) -nnoremap u :call wrap('u',v:count) -nnoremap U :call wrap('U',v:count) -nnoremap :call wrap("\C-R>",v:count) - -augroup repeatPlugin - autocmd! - autocmd BufLeave,BufWritePre,BufReadPre * let g:repeat_tick = (g:repeat_tick == b:changedtick || g:repeat_tick == 0) ? 0 : -1 - autocmd BufEnter,BufWritePost * if g:repeat_tick == 0|let g:repeat_tick = b:changedtick|endif -augroup END - -" vim:set ft=vim et sw=4 sts=4: -- 2.43.2