Skip to content

Latest commit

 

History

History
126 lines (93 loc) · 4.12 KB

README.md

File metadata and controls

126 lines (93 loc) · 4.12 KB

icon

VimMulticursor

Build Version Downloads

This plugin adds multiple cursor and selection capabilities to IdeaVim

Preview

Installation & Setup

  1. Install the plugin:

    • Open IntelliJ IDEA
    • Go to Settings/Preferences → Plugins → Marketplace
    • Search for "VimMulticursor"
    • Click Install and restart your IDE
  2. Enable the plugin:

    • Add the following line to the top of your ~/.ideavimrc file:
      set multicursor
      
    • Reload IdeaVim settings (:action IdeaVim.ReloadVimRc)

Commands

Basic Usage

  • mc + command: Create multiple cursors
  • ms + command: Create multiple selections
  • All commands work within selected text when there's an active selection

Available Commands

  • mc/ + search: Add cursors at all occurrences of search regex.
  • mcfx, mcFx: 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 word
  • mca + bracket: Around bracket, like mca(/mcab, mca{/mcaB, mca", etc
  • mci + bracket: Inside bracket, like mci(/mcib, mci{/mciB, mci", etc
  • mcaa/mcia: any bracket

Cursor Management

  • mcc: Add or remove a cursor highlight at the current position (preview mode)
  • mcr: Convert cursor highlights to active editing cursors
  • mcd: Remove all cursors and highlights
  • mcia: Place cursors inside any brackets or quotes ((), [], {}, "", '', ``)
  • mcaa: Place cursors around any brackets or quotes
  • mcaw: 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.

Examples

  1. Select all occurrences of "print":

    ms/print<Enter>
    
  2. Create cursors at each word start in selection:

    msw
    
  3. Add cursors at specific positions:

    1. Move cursor to desired position
    2. Type mcc to add a cursor highlight
    3. Repeat for more positions
    4. Type mcr to convert highlights into editing cursors

Optional Key Mappings

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)

Troubleshooting

  1. Commands not working?

    • Ensure set multicursor is at the top of .ideavimrc
    • Restart IdeaVim after changes
    • Check if IdeaVim plugin is enabled
  2. Cursors not appearing?

    • Ensure you are in normal mode
    • Try clearing all cursors with mcd
    • If issues persist, restart your IDE

License

Just as IdeaVim, this plugin is licensed under the terms of the GNU Public License version 3 or any later version.

Credits

Plugin icon is merged icons of IdeaVim plugin and a random sneaker by FreePic from flaticon.com

Installation

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