Bumbread's Cursor Util extensionThis extension adds new ways to (ab)use multicursors in vscode. It includes some known commands of this nature like inserting consecutive numbers at multicursor, as well as some vim commands like matching the next character or moving to matching paren/brace/bracket. Below I will try to demonstrate how this works using simple text files and known
usecases. The One of the common pattern this package utilizes is "transform into selection". From a selection it's easy to go forward or backwards to the start or the end of the selection. cursor-util.insert-numbersThis command inserts numbers into each of the multicursor. Some of its features:
Example of usage:
After executing this command and executing this command (selecting all the default options) will yield the following:
And each cursor will change to a selection of the inserted number. How to use:
cursor-util.merge-selectionsWill merge multiple cursor into one big selection. Useful for exiting the multicursor mode with the easy ability to proceed to the position of the first or the last cursor. cursor-util.find-forwards, cursor-util.find-backwardsFinds the next specified instance of a character on the current line for each cursor and moves the cursor to that position.
Executing find-forwards and selecting the capital "J" character will move every
multicursor to the beginning of the word
We can add
cursor-util.find-forwards-select, cursor-util.find-backwards-selectSame as above, but create a selection between the start and the end position of the cursor. cursor-util.move-matching-braces/brackets/parensMoves each cursor between the matching "[]", "{}" or "()" characters. If the character at the position of the cursor is not either of those characters, moves to the closing brace/bracket/paren. |