Skip to content
/
Try

Multiple cursors in Skink: Ctrl+D, Alt+click and more

Ctrl+D for the next match, Alt+Shift+↓ for the line below.

Press Ctrl+D to select the word under the cursor, then press it again to add a cursor at the next match. Type, and every cursor types. Esc goes back to a single cursor.

This works like Sublime Text and VS Code, with Micro’s action names.

Key Typed command Does
Ctrl+D or Alt+N :addcursor Select the word; again: add a cursor at the next match
Alt+X :skipcursor Skip this match and select the next one
Alt+Shift+↑ / ↓ :cursorabove / :cursorbelow Add a cursor on the line above / below
Ctrl+Alt+↑ / ↓ same An alternative binding for the same
Alt+click Add a cursor, or remove the one under the mouse
Esc or Alt+C :onecursor Back to one cursor

The status line shows ×N while you have N cursors.

  • Typing, deleting, moving, indenting and moving lines (Alt+↑ / ↓).
  • Case changes, join, sort and trim (:UpperCase, :LowerCase, :TitleCase, :JoinLines, :SortLines, :TrimTrailingWhitespace).
  • One undo (Ctrl+Z) undoes the change at all cursors.
  • Copy with N cursors puts one line per cursor on the clipboard.
  • Pasting N lines into N cursors gives each cursor its own line.

So you can copy five values from five places and paste them into five other places in one go.

Put the cursor on the name and press Ctrl+D once to select it. Press it again for each use you want, and Alt+X to skip a match you do not want. Type the new name.

For a rename across files that understands your code, use the language server instead: Alt+Shift+R. See Refactoring.

Put the cursor on the first line and press Alt+Shift+↓ nine times. Press End, then type ,.

For a plain replace-all, the find bar is quicker: Ctrl+F, type, Tab, type the replacement, Enter. See Find and replace.

The actions use Micro’s names, so they can be bound in bindings.json:

Action Does
SpawnMultiCursor Select the word, then add a cursor at the next match
SpawnMultiCursorUp / SpawnMultiCursorDown Add a cursor above / below
SkipMultiCursor Skip this match and select the next
RemoveMultiCursor Remove the newest cursor
RemoveAllMultiCursors Back to a single cursor

For example, to remove the newest cursor with Alt+Shift+X (Micro’s format writes Shift as a capital letter):

{ "Alt-X": "RemoveMultiCursor" }

See Key bindings.