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.7k
關注者數33
派生數93
提交數801
已啟用問題?
問題數239
打開的問題數26
拉請求數16
打開的拉請求數2
關閉的拉請求數14
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?