vim-visual-multi

Multiple cursors project for vim/neovim (wip)

Github星跟踪图

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

主要指标

概览
名称与所有者mg979/vim-visual-multi
主编程语言Vim Script
编程语言Python (语言数: 3)
平台
许可证MIT License
所有者活动
创建于2018-04-12 06:55:46
推送于2024-09-01 18:09:22
最后一次提交2024-09-01 13:09:22
发布数13
最新版本名称v0.5.8 (发布于 2020-09-03 20:21:57)
第一版名称v0.2 (发布于 )
用户参与
星数4.6k
关注者数33
派生数88
提交数801
已启用问题?
问题数237
打开的问题数26
拉请求数16
打开的拉请求数2
关闭的拉请求数14
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?