No description
  • Vim Script 94.2%
  • Python 5.8%
Find a file
Mike Iversen a6975e7c1e
Fix #276: Remove non-silent echo (#277)
Use `redraw!` instead of annoying `echo "\r"`
2024-09-01 20:09:22 +02:00
.github feat: luarocks support (#262) 2024-04-03 04:37:40 +02:00
autoload Fix #276: Remove non-silent echo (#277) 2024-09-01 20:09:22 +02:00
doc g:VM_add_cursor_at_pos_no_mappings (default 0) 2024-04-26 06:31:04 +02:00
plugin style: change default for VM_Mono 2024-07-05 08:59:00 +02:00
python Remove vm#commands#erase_regions() 2019-10-13 08:06:08 +02:00
test test: clear vim env variables 2022-06-10 10:25:54 +02:00
.gitignore Fix for some operations at cursors 2019-01-10 12:37:47 +01:00
.travis.yml Add test environment 2018-12-20 20:14:37 -08:00
LICENSE License, readme 2018-04-12 09:10:26 +02:00
README.md Add VIM 8+ install instructions (#169) 2021-06-01 22:11:07 +02:00
run_tests add run_tests 2021-08-02 12:36:52 +02:00
tutorialrc fix #138: set nocompatible 2020-08-14 17:35:04 +02:00

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'}

With Vim 8+:

mkdir -p ~/.vim/pack/plugins/start && git clone https://github.com/mg979/vim-visual-multi ~/.vim/pack/plugins/start/vim-visual-multi

Documentation

:help visual-multi

For some specific topic it's often:

:help vm-some-topic

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


Synched column transposition

Imgur


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

Imgur


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

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 vertically.

Imgur


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

Imgur


Case conversion

Imgur