" repeat.vim - Let the repeat command repeat plugin maps " Maintainer: Tim Pope " Version: 1.2 " GetLatestVimScripts: 2136 1 :AutoInstall: repeat.vim " Installation: " Use a plugin manager. " " For manual installation copy plugin/repeat.vim and autoload/repeat.vim into " ~/.vim/plugin/repeat.vim and ~/.vim/autoload/repeat.vim respectively. " " License: " Copyright (c) Tim Pope. Distributed under the same terms as Vim itself. " See :help license " " 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. " " For mappings that use a register and want the same register used on " repetition, use: " " silent! call repeat#setreg("\MappingToRepeatCommand", v:register) " " This function can (and probably needs to be) called before making changes to " the file (as those typically clear v:register). Therefore, the call sequence " in your mapping will look like this: " " nnoremap MyMap " \ :execute 'silent! call repeat#setreg("\Plug>MyMap", v:register)' " \ call MyFunction(v:register, ...) " \ silent! call repeat#set("\Plug>MyMap") if exists("g:loaded_repeat") || &cp || v:version < 800 finish endif let g:loaded_repeat = 1 let g:repeat_tick = -1 let g:repeat_reg = ['', ''] nnoremap (RepeatDot) :if !repeat#run(v:count)echoerr repeat#errmsg()endif nmap