Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime like Multiple Cursors in HTML5

Do you have an idea how to get the Sublime or Cloud 9 like Multiple Cursors functionality to the browser?

I want multiple cursors in a textarea, maybe in multiple text areas. Should be possible with HTML5, but didn't find anything in the web!

Thank you!

like image 506
user2409234 Avatar asked May 22 '13 11:05

user2409234


People also ask

How do I make multiple cursors in Sublime Text?

While you can place multiple text cursors in Sublime Text with Cmd–Click (Mac) or Ctrl–Click (Windows), here's another technique that comes in handy. Hold Ctrl–Shift (Mac) or Ctrl–Alt (Windows) and hit Up or Down Arrow to place an additional text cursor above or below the current cursor.

How do I use multiple cursors in HTML?

You can add secondary cursors (rendered thinner) with Alt+Click. Each cursor operates independently based on the context it sits in. A common way to add more cursors is with Shift+Alt+Down or Shift+Alt+Up that insert cursors below or above.

How do I remove multiple cursors in Sublime Text?

You have to hold shift+cmd (or alt on non-Mac) and drag a selection with the mouse that includes the cursors or selections you want to remove.


1 Answers

As barlop said ace editor has multiple cursors, if you want to take a look to its magic you could maybe take a look to multi_select.js at aces github repo.

In order to give you a little idea on how to do it, there's no textarea except under the main cursor. Ace breaks down text into multiple divs with the appeareance of a big textarea. When you place multiple cursors, ace copies the text entered in the main cursor to the other spans or divs.

like image 87
Alvaro Pinot Avatar answered Sep 20 '22 00:09

Alvaro Pinot