This plugin adds multiple cursor and selection capabilities to IdeaVim
-
Install the plugin:
- Open IntelliJ IDEA
- Go to Settings/Preferences → Plugins → Marketplace
- Search for "VimMulticursor"
- Click Install and restart your IDE
-
Enable the plugin:
- Add the following line to the top of your
~/.ideavimrc
file:set multicursor
- Reload IdeaVim settings (
:action IdeaVim.ReloadVimRc
)
- Add the following line to the top of your
mc
+ command: Create multiple cursorsms
+ command: Create multiple selections- All commands work within selected text when there's an active selection
mc/
+ search: Add cursors at all occurrences of search regex.mcf
x,mcF
x: Add cursors at all occurrences of character x.mcw
,mcW
,mcb
,mcB
: Add cursors at words start.mce
,mcE
: Add cursors at words end.mcaw
: Around wordmca
+ bracket: Around bracket, likemca(
/mcab
,mca{
/mcaB
,mca"
, etcmci
+ bracket: Inside bracket, likemci(
/mcib
,mci{
/mciB
,mci"
, etcmcaa
/mcia
: any bracket
mcc
: Add or remove a cursor highlight at the current position (preview mode)mcr
: Convert cursor highlights to active editing cursorsmcd
: Remove all cursors and highlightsmcia
: Place cursors inside any brackets or quotes ((), [], {}, "", '', ``)mcaa
: Place cursors around any brackets or quotesmcaw
: Add cursors at word boundaries (at the start and end of current word)
The mcia
and mcaa
commands automatically find the nearest matching pair of delimiters around the cursor, handling proper nesting and matching of brackets/quotes.
-
Select all occurrences of "print":
ms/print<Enter>
-
Create cursors at each word start in selection:
msw
-
Add cursors at specific positions:
- Move cursor to desired position
- Type
mcc
to add a cursor highlight - Repeat for more positions
- Type
mcr
to convert highlights into editing cursors
Add these to your ~/.ideavimrc
for faster access:
" Quick search-select
map q <Plug>(multicursor-ms/)
" Quick cursor add/apply
map z <Plug>(multicursor-mcc)
map Z <Plug>(multicursor-mci)
" Word-based selections
map <leader>w <Plug>(multicursor-msw)
map <leader>b <Plug>(multicursor-msb)
-
Commands not working?
- Ensure
set multicursor
is at the top of.ideavimrc
- Restart IdeaVim after changes
- Check if IdeaVim plugin is enabled
- Ensure
-
Cursors not appearing?
- Ensure you are in normal mode
- Try clearing all cursors with
mcd
- If issues persist, restart your IDE
Just as IdeaVim, this plugin is licensed under the terms of the GNU Public License version 3 or any later version.
Plugin icon is merged icons of IdeaVim plugin and a random sneaker by FreePic from flaticon.com
-
Using IDE built-in plugin system:
Settings/Preferences > Plugins > Marketplace > Search for "VimMulticursor" > Install Plugin
-
Manually:
Download the latest release and install it manually using Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...
Plugin based on the IntelliJ Platform Plugin Template.