-
Notifications
You must be signed in to change notification settings - Fork 86
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 can be 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 alignment (at cursors, by character or regex)
- text transposition (synched inline, or cycling)
- text shift (move selected text left and right)
- numbering with expressions and separators
- run macros/normal/visual/ex commands at cursors
- built-in integration with vim-surround
- select operator (select with motion, works with any custom operator)
- find operator (find occurrences in text objects)
Important: mappings you can see in pictures may be outdated, so don't trust pictures for mappings.
Important: The master branch could be behind the test branch.
Currently recommended branch: master
Mappings have been reworked rather recently. This wiki reflects these changes.
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.
More about mappings here