-
Notifications
You must be signed in to change notification settings - Fork 88
Home
Welcome to vim-visual-multi (VM from now on)! This is a very ambitious plugin that tries to bring the true multiple cursor experience to vim, without compromises. That is, without renouncing to any of the features you see in other editors' multiple cursors implementations. It's, for now, in beta state: all features are there, but some can be improved, and there are still bugs to fix/imperfections to iron out. Please have patience if you find bugs, and open an issue in the issues tracker.
Due to the nature of vim, multiple cursors here are more powerful than those you have in other editors: you can add them, skip them, navigate throught them back and forth, remove them one by one, jump to another part of the file and add them at arbitrary positions, turn cursors into selections or collapse selections into cursors, move cursors/extend all selections with motions, resize individual selections, add regions with regex, select all words/regex patterns... And much more.
Extra features mimic some popular features of other editors, some of which only provided by extensions for the said editors:
- text transposition (synched inline, or cycling)
- text shift (move selected text left and right)
- text alignment (by character or regex)
- numbering with expressions and separators
- duplicate selections
- run macros/normal/visual/ex commands at cursors
- built-in integration with vim-surround
- block mode (conceptually similar to visual block)
- select operator (select with motion, works with any custom operator)
Important: The master branch could be behind the test branch.
Currently recommended branch: master
Many mappings in this wiki aren't up to date, but you can press F1 after VM has started, to see what your current mappings are. This should make it easier use the plugin.
To install VM with vim-plug
using the test branch, add to your vimrc in the
plugs section:
Plug 'mg979/vim-visual-multi', {'branch': 'test'}
There's also a configuration tool. To start it:
:VMConfig
Nor the master or the test branch are bug free.
Some usage examples.
There are a lot of new defined mappings: most of them are <buffer> mappings, that are unmapped when you exit VM mode. They are too many to be presented together, I'll mention them with the features they're related to.
More about mappings here