Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selecting multiple lines in Atom

Is there any way in Atom to replicate the feature in Sublime Text where you can hold down the alt key and move the mouse up or down to select and create a cursor at the end of multiple line so you can edit multiple lines simultaneously?

like image 542
pyCthon Avatar asked Aug 31 '14 23:08

pyCthon


2 Answers

If I understand your question correctly, you want to select multiple lines and create a cursor at the end of each line. There are a couple ways you can achieve this:

  1. Using Split Into Lines
    1. Highlight multiple lines however you like.
    2. Use the Selection|Split Into Lines command (Cmd+Shift+L on OS X or press Cmd/Ctrl+Shift+P and type Split Into Lines) to split the multiline selection into a selection for each line.
    3. Press the right arrow by itself to reveal the cursor at the end of the selections.
  2. Using Add Selection Below
    1. Position the cursor on the line above the first line you want to select
    2. Use Selection|Add Selection Below to add as many lines with cursors as you want
    3. Use normal cursor positioning commands to place the cursors where you want
like image 140
Lee Avatar answered Sep 22 '22 07:09

Lee


I am big fan of Sublime Text 3, Atom is really nice but can't beat Sublime :)

Well, you can give a try to make "Your Favorite Sublime Key 'CTRL+SHIFT+L'" within ATOM to get Multi Line Selection with multi cursor:

File > Keymap...

Paste below code and smile :)

'atom-text-editor':     'ctrl-shift-l': 'editor:split-selections-into-lines' 

Save and Close Tab. Open any file and Press "CTRL+SHIFT+L". Now magic :D, Press Arrow key and You will see Multiple Cusor on Selected Lines.

like image 22
Nono Avatar answered Sep 22 '22 07:09

Nono