WebStorm-style multi-cursor paste: when you copy N selections and paste with fewer cursors, paste the first cursor-count items (one per cursor) instead of dumping everything at every cursor. Configurable: WebStorm behavior, VS Code default, or ask each time.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Bring WebStorm's intuitive multi-cursor paste behavior directly into VS Code! ✨
🛑 The Problem
In WebStorm, if you copy 4 selections (using 4 cursors) and paste them using 3 cursors, the first 3 items are pasted neatly — exactly one per cursor.
In vanilla VS Code, doing the same thing pastes all 4 items at every single one of the 3 cursors, leaving you with a messy duplication to clean up.
✨ How It Works
This extension fixes the mismatch by replacing the default copy/cut/paste commands with smart, context-aware alternatives.
⌨️ Smart Keybindings: Rebinds Ctrl/Cmd+C, Ctrl/Cmd+X, and Ctrl/Cmd+V in the editor to track how many cursors were active during the copy. Everything else is safely delegated to VS Code's built-in clipboard commands.
⚙️ Customizable Mismatch Behavior: When pasting with fewer cursors than copied selections, the extension follows your smartPaste.mismatchBehavior setting:
🎯 pasteFirstN(Default) — The WebStorm way: Pastes the first cursor-count items, one per cursor, in document order.
🔁 vscodeDefault — The standard VS Code way: Pastes the entire copied text block at each destination cursor.
🤔 ask — Shows a lightweight quick-pick menu (similar to the Quick Fix menu) letting you choose on the fly.
🖱️ Strictly Multi-Cursor: The smart behavior only applies when the copy was made with more than one cursor. If you copy multiple lines with a single cursor, it predictably pastes the whole clipboard at every destination. (This conveniently stops VS Code from silently splitting lines when line count randomly matches cursor count).
🌐 External Fallback: If you copy text from your browser, terminal, or another app, the extension leaves it alone and falls back to vanilla VS Code paste.
📌 Notes & Tips
✂️ Cut works too: Cutting with multiple cursors records segments exactly the same way as copying.
🎛️ Keybinding Conflicts: If you already have custom keybindings for Ctrl+C/X/V, you may need to adjust their precedence in the VS Code Keyboard Shortcuts editor.
🛠️ Development
Want to contribute or build from source?
npm run build # 🏗️ Compile the extension
npm test # 🧪 Compile + run unit tests (node --test)