Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Multiple cursors plugin for vim/neovim

License

NotificationsYou must be signed in to change notification settings

mg979/vim-visual-multi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

It's calledvim-visual-multi in analogy withvisual-block, but the plugin works mostly from normal mode.

Basic usage:

  • select words withCtrl-N (likeCtrl-d in Sublime Text/VS Code)
  • create cursors vertically withCtrl-Down/Ctrl-Up
  • select one character at a time withShift-Arrows
  • pressn/N to get next/previous occurrence
  • press[/] to select next/previous cursor
  • pressq to skip current and get next occurrence
  • pressQ to remove current cursor/selection
  • start insert mode withi,a,I,A

Two main modes:

  • incursor mode commands work as they would in normal mode
  • inextend mode commands work as they would in visual mode
  • pressTab 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

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

You could read at least theQuick 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


[8]ページ先頭

©2009-2025 Movatter.jp