Top Related Projects
Vim plugin: Create your own text objects
Vim plugin that provides additional text objects
Neovim's answer to the mouse 🦘
Quick Overview
vim-repeat is a Vim plugin that enables plugins to tap into the power of the .
command. It allows for repeating plugin maps with .
, extending Vim's native repeat functionality to custom commands and operations defined by other plugins.
Pros
- Enhances Vim's native repeat functionality
- Seamlessly integrates with many popular Vim plugins
- Lightweight and easy to install
- Improves workflow efficiency for Vim users
Cons
- Requires plugin authors to specifically support it
- May not work with all plugins or custom mappings
- Can potentially conflict with other plugins that modify the
.
command - Slight learning curve to understand which operations are repeatable
Getting Started
- Install vim-repeat using your preferred Vim plugin manager. For example, using vim-plug:
Plug 'tpope/vim-repeat'
-
After installation, vim-repeat will work automatically with supported plugins.
-
To make your own plugin work with vim-repeat, use the
repeat#set()
function:
silent! call repeat#set("\<Plug>MyPluginAction", v:count)
- For users, simply use the
.
command after performing a supported action to repeat it.
Competitor Comparisons
Vim plugin: Create your own text objects
Pros of vim-textobj-user
- Provides a framework for creating custom text objects in Vim
- Allows for more granular and specific text selections
- Extensible with plugins for various language-specific text objects
Cons of vim-textobj-user
- Requires more setup and configuration compared to vim-repeat
- May have a steeper learning curve for users new to custom text objects
- Potentially more complex to use in scripts or mappings
Code Comparison
vim-textobj-user:
call textobj#user#plugin('example', {
\ 'date': {
\ 'pattern': '\<\d\d\d\d-\d\d-\d\d\>',
\ 'select': ['ad', 'id'],
\ },
\ })
vim-repeat:
silent! call repeat#set("\<Plug>MyAwesomeMap", v:count)
Key Differences
- vim-textobj-user focuses on creating custom text objects, while vim-repeat enhances the repeatability of plugin maps
- vim-repeat is generally simpler to use and integrate into existing workflows
- vim-textobj-user offers more flexibility in defining complex text selections
Use Cases
- Use vim-textobj-user when you need to create custom text objects for specific languages or file types
- Choose vim-repeat when you want to improve the usability of existing plugin mappings by making them repeatable
Vim plugin that provides additional text objects
Pros of targets.vim
- Provides more precise text object selection, allowing for complex targeting of content
- Offers a wider range of text objects, including separators, arguments, and quotes
- Enhances Vim's built-in text objects with more granular control
Cons of targets.vim
- Steeper learning curve due to the additional commands and text objects
- May conflict with other plugins or custom mappings that modify text objects
- Requires more mental overhead to remember and utilize all the available options
Code comparison
targets.vim:
" Select inside next parentheses
cin)
" Select around second next quote
2an"
" Delete inside last square brackets
dil]
vim-repeat:
" Repeat last change with .
.
" Repeat a plugin map
:call repeat#set("\<Plug>MyPlugin", v:count)
Summary
targets.vim focuses on expanding Vim's text object selection capabilities, offering more precise and varied targeting options. vim-repeat, on the other hand, enhances Vim's repeat functionality, allowing for better integration with plugin commands. While targets.vim provides powerful selection tools, it comes with a steeper learning curve. vim-repeat is simpler in concept but greatly improves workflow efficiency when working with plugins.
Neovim's answer to the mouse 🦘
Pros of leap.nvim
- Provides advanced motion capabilities for Neovim, enhancing navigation efficiency
- Offers a more modern and feature-rich approach to cursor movement
- Actively maintained and regularly updated
Cons of leap.nvim
- Requires Neovim, limiting compatibility compared to vim-repeat
- May have a steeper learning curve for users accustomed to traditional Vim motions
- Potentially more complex setup and configuration
Code Comparison
vim-repeat:
silent! call repeat#set("\<Plug>MyWonderfulMap", v:count)
leap.nvim:
require('leap').add_default_mappings()
require('leap').leap { target_windows = { vim.fn.win_getid() } }
Key Differences
- Purpose: vim-repeat enhances the dot command for plugin actions, while leap.nvim focuses on improving cursor movement
- Scope: vim-repeat is a utility for other plugins, whereas leap.nvim is a standalone motion plugin
- Implementation: vim-repeat is written in Vimscript, while leap.nvim uses Lua for Neovim integration
Use Cases
- vim-repeat: Ideal for users who frequently use the dot command and want to extend its functionality
- leap.nvim: Best for Neovim users seeking to optimize their navigation and cursor movement within files
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
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)
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
.
Top Related Projects
Vim plugin: Create your own text objects
Vim plugin that provides additional text objects
Neovim's answer to the mouse 🦘
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot