Skip to content

NicklasLallo/vim-repeat

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 

Repository files navigation

repeat.vim

If you've ever tried using the . command after a plugin map, you were likely disappointed to discover it only repeated the last native command inside that map, rather than the map as a whole. That disappointment ends today. Repeat.vim remaps . in a way that plugins can tap into it.

The following plugins support repeat.vim:

Adding support to a plugin is generally as simple as the following command at the end of your map functions.

silent! call repeat#set("\<Plug>MyWonderfulMap", v:count)

Fork

This fork changes two things:

  • It disables the default maps for u, U, & ctrl+r. To restore them use:
nmap u <Plug>(RepeatUndo)
nmap U <Plug>(RepeatUndoLine)
nmap <C-R> <Plug>(RepeatRedo)
  • It adds a optional wrapper that supports remapping so that you can use other functions together with this:
    nnoremap <silent> u     :<C-U>call repeat#wrapMod("\<Plug>(highlightedundo-undo)",v:count)<CR>

This is mainly useful when you want to chain u, U, & ctrl+r together with other plugins and vim-repeat without breaking vim-repeat. For other use cases repeat#set() should be sufficient.

Installation

Install using your favorite package manager, or use Vim's built-in package support:

mkdir -p ~/.vim/pack/tpope/start
cd ~/.vim/pack/tpope/start
git clone https://tpope.io/vim/repeat.git

Contributing

See the contribution guidelines for pathogen.vim.

Self-Promotion

Like repeat.vim? Follow the repository on GitHub and vote for it on vim.org. And if you're feeling especially charitable, follow tpope on Twitter and GitHub.

License

Copyright (c) Tim Pope. Distributed under the same terms as Vim itself. See :help license.

About

repeat.vim: enable repeating supported plugin maps with "."

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Vim Script 100.0%