vim-visual-multi

Multiple cursors project for vim/neovim (wip)

Github stars Tracking Chart

vim-visual-multi

It's called vim-visual-multi in analogy with visual-block, but the plugin works mostly from normal mode.

Basic usage:

  • select words with Ctrl-N (like Ctrl-d in Sublime Text/VS Code)
  • create cursors vertically with Ctrl-Down/Ctrl-Up
  • select one character at a time with Shift-Arrows
  • press n/N to get next/previous occurrence
  • press [/] to select next/previous cursor
  • press q to skip current and get next occurrence
  • press Q to remove current cursor/selection
  • start insert mode with i,a,I,A

Two main modes:

  • in cursor mode commands work as they would in normal mode
  • in extend mode commands work as they would in visual mode
  • press Tab to switch between «cursor» and «extend» mode

Most vim commands work as expected (motions, r to replace characters, ~ to change case, etc). Additionally you can:

  • run macros/ex/normal commands at cursors
  • align cursors
  • transpose selections
  • add patterns with regex, or from visual mode

And more... of course, you can enter insert mode and autocomplete will work.

Installation

With vim-plug:

Plug "mg979/vim-visual-multi", {'branch': 'master'}

Documentation

:help visual-multi

Tutorial

To run the tutorial:

vim -Nu path/to/visual-multi/tutorialrc

Wiki

The wiki was the first documentation for the plugin, but many pictures are
outdated and contain wrong mappings. Still, you can take a look.

You could read at least the Quick Start.


Some (sometimes very old) random pics:


Insert mode with autocomplete, alignment (mappings in pic have changed, don't trust them)

Imgur


Undo/Redo edits and selections

Imgur


Alternate cursor/extend mode, motions (even %), reverse direction (as in visual mode) and extend from the back. At any time you can switch from extend to cursor mode and viceversa.

Imgur


Select inside/around brackets/quotes/etc:

Imgur


Select operator, here shown with 'wellle/targets.vim' plugin: sib, sia, saa + selection shift

Imgur


Single region mode in insert mode, Tab moves to the next cursor

Imgur


Synched column transposition

Imgur


Unsynched transposition (cycle all regions, also in different lines)

Imgur


Shift regions left and right (M-S-<>)

Imgur


Independent anchoring

Imgur


Find words under cursor, add new words (patterns stack), navigate regions, skip them, add regions with regex.

Imgur


Normal/Visual/Ex commands at cursors

Imgur


Macros. Shorter lines are skipped when adding cursors above/below.

Imgur


Some editing functions: yank, delete, paste from register, paste block from yanked regions

Imgur


Case conversion

Imgur

Main metrics

Overview
Name With Ownermg979/vim-visual-multi
Primary LanguageVim Script
Program languagePython (Language Count: 3)
Platform
License:MIT License
所有者活动
Created At2018-04-12 06:55:46
Pushed At2024-09-01 18:09:22
Last Commit At2024-09-01 13:09:22
Release Count13
Last Release Namev0.5.8 (Posted on 2020-09-03 20:21:57)
First Release Namev0.2 (Posted on )
用户参与
Stargazers Count4.6k
Watchers Count33
Fork Count88
Commits Count801
Has Issues Enabled
Issues Count237
Issue Open Count26
Pull Requests Count16
Pull Requests Open Count2
Pull Requests Close Count14
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private