Multi-Cursor Script Editing: Now in Beta!

Hey Developers!

We’re excited to announce the Multi-Cursor Script Editing beta, a new feature in Script Editor that allows you to edit multiple lines of code simultaneously. Multi-Cursor can help you write code faster by helping you avoid rewriting repetitive code, copying and pasting code, formatting long lists, and more!

To enable the beta in Studio, go to File > Beta Features > Enable Multi-Cursor Script Editing.

Features

Add/Remove Cursor at Mouse

Click anywhere in the script editor to place cursors. Using the same shortcut, click on a cursor to remove it. Alt/⌥ + Click

AddWithClickLooped

RemoveWithClickLooped


Remove Most Recently Added Cursor

Remove the most recently added cursor. Ctrl/⌘ + U

UndoRecentCursorLooped


Add Cursor Above/Below

Place a cursor directly above or below each existing cursor.
Ctrl + Alt + ↑/↓
⌘+⌥ + ↑/↓

AddAboveBelowLooped


Add Cursor to Next/Prev Matching Selection

Select a segment of code and then use the keyboard shortcut to select the next/previous matching segment. Ctrl/⌘+ D

Note: To add a cursor to the previous selection, use the Quick Open Window with Ctrl/⌘ + P and search for >Select previous occurrence!

You can also create a shortcut of your choice via the Customize Shortcuts window: File > Advanced > Customize Shortcuts > search for Select previous occurrence.

AddToNextPrevMatchLooped


Add Cursor to All Matching Selections

Select a segment of code and then use the keyboard shortcut to select all matching segments. Shift + Alt + L / + + L

AllMatchingSelectionsLooped


Add/Modify Cursor with Mouse Drag

Add a cursor with a selection or modify an existing selection by using mouse drag.
Alt/⌥ + Drag

AddWithDragLooped


Copy/Paste

Copy selections from multiple cursors and paste them at new cursor locations! The behavior of this feature depends on the number of cursors copied and pasted to:

  1. If the number of cursors are the same, then each copied cursor pastes to each corresponding destination cursor.

  2. If the number of cursors are different, then each cursor at the destination receives the entire paste with each copied cursor as a new line.

CopyPasteLooped

Here is a summary and keybinds for all the changes coming with this beta! For more information, please visit our documentation page.

Feature Windows macOS
Add/Remove Cursor at Mouse Alt + Click + Click
Remove Most Recently Added Cursor Ctrl + U + U
Add Cursor Above/Below Above: Ctrl + Alt + Below: Ctrl + Alt + Above:+ + Below: + +
Add Cursor to Next/Prev Matching Selection Ctrl + D + D
Add Cursor to Every Matching Selection Shift + Alt + L + + L
Add/Modify Cursor with Mouse Drag Alt + Drag + Drag
Copy/Paste Copy: Ctrl + CPaste: Ctrl + V Copy: + C Paste: + V

Known Issues

Here is a list of known issues the team is actively working on resolving, these will be addressed in updates throughout the beta:

  • Performance degradation when typing with ~100 or more cursors
  • Some lines are not being highlighted when cursors are on empty lines
  • Smaller miscellaneous edge case and behavior bugs

Looking Forward

We are using this beta to allow the Developer community to get their hands on Multi-cursor and provide any feedback/feature requests. With that in mind, we have the following planned for the Full Release of Multi-Cursor Script Editing:

Column/Block Select
Select a column or block of code/whitespace, cursors will be placed at the end of the selected block.

Match Case/Whole Word
Specify case and whole word matches when using Add Cursor to Next/Prev Match and All Matching Selections.

Split Selections into Lines
Place cursors at the end of the selections. If a selection crosses between multiple lines, the selection is split at each line end.

On-Type Formatting
Format code typed at all cursors.

Scroll Bar Markers
A visual indicator for all cursor locations on the scroll bar.


We are so excited to share this new feature with the Developer community and hope that this functionality empowers you to code more efficiently and improve your scripting experience.

Please share your feedback down below, and let us know if you have any questions or concerns!

A huge thank you to the following for their amazing efforts in developing this feature: @HugoBLH, @BobaTops, @code4xp, @mugiwarasuuper, @windy0724, @Infomancer, @idevride and @rusi_002!

Happy scripting!

487 Likes

This topic was automatically opened after 10 minutes.

Wow, very good, I only have 2 questions:
When will I ever have to use this? Like when will writing the same thing over and over help me?
Also, this is made to make the things that are written a lot of times be less, but wasn’t Generative AI meant to go that? Did you scrap Generative AI? (I hope so)

31 Likes

Oh yes please :weary::weary:. Gone are the days of me forgetting to add semi colons to my tables, and taking hours to add them.

60 Likes

Very good implementation, one of the most important functions of Sublime Text.
When Studio’s native script editor is also providing bookmarks, maybe I’ll start using that.

18 Likes

This honestly seems like an interesting update but I can’t see myself using it much, if ever

19 Likes

I put this in a Roblox Script Editor feedback form a very long time ago, and I’m glad it’s finally in beta. Slowly, I feel that the Roblox Studio Script Editor is competing with external editors like VSCode, and that’s pretty awesome.

23 Likes

As a primary iOS developer, I am jealous that Roblox is getting this! If only Xcode had this…

Will definitely be excited to use this in Roblox tho!

16 Likes

This feels so weird that I enjoy it now :thinking:

(pretty handy feature, only caveat is the amount of keybinds you have to learn)

15 Likes

glad this feature came from IDE’s, it’s really handy and I’m lovin’ it. Roblox still manages to keep up a good update streak, which I’m glad of that.

18 Likes

Finally! Thank you so much, this is the one feature I have been missing. Could’ve used it last night. Another good beta release!

12 Likes

This a very good update, I hope this will make it easier for people

7 Likes

I use this all the time in Sublime Text for all the repeat editing action.
Here’s a video that shows some of this potential (I don’t know if what was done in Studio has all these features):

14 Likes

Huh, confused how this is an issue; not sure who’d exactly need 100 cursors but if you do, uh wow I guess.

13 Likes

That’s exactly what I thought at first :rofl::rofl::rofl:

Also, when will I need this? I don’t understand

Also, wasn’t this what Generative AI was meant to do?

7 Likes

To edit a hundred lines at once?

This literally has nothing to do with generative AI.

@Dede_4242 not talk about generative ai in a post challenge IMPOSSIBLE1!1!1!:scream::scream:

13 Likes

WOO I LOVE THIS
thank you roblox :pray: :pray: :pray:

28 Likes

I once used this in Visual Studio Code. It’s pretty awesome when it comes to repetitive lines.

5 Likes

Like, from what I’ve seen thsi makes the same thing on more than one line, but when will I need to write something like:

local variable = variable
local variable = variable

?

What? I want to know

5 Likes

thank you :pray: this makes editing tables and lots of text much much easier!

6 Likes