Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime text 3. How to edit multiple lines? [duplicate]

I was using Notepad++ and now I want to use the same cool features in Sublime but I don't know how. I want to edit multiple lines at the same time like this:

But I don't want to Ctrl+Click at each line for this. I want to click at first line and click at last line for one vertical line.

How I can do this?

like image 519
Lory Avatar asked Sep 18 '16 10:09

Lory


People also ask

How do I edit multiple lines in Sublime Text?

To select multiple regions using the keyboard, select a block of text, then press Ctrl+Shift+L to split it into one selection per line. When you're done with using multiple selections, just press Ctrl+K to trim all but the first.

How do you edit multiple lines at once?

Select the lines you want and then press: Windows: Shift + Alt + i. Mac: shift + option + i.

How do you copy multiple lines in Sublime Text?

You can duplicate selected text blocks with Ctrl+Shift+D several times.


2 Answers

First, select multiple lines (by dragging mouse, shift+arrow, etc.). Then, press:

CTRL+SHIFT+L

or on MAC: CMD+SHIFT+L (as per comments)

Alternatively you can select lines and go to SELECTION MENU >> SPLIT INTO LINES.

Now you can edit multiple lines, move cursors etc. for all selected lines.

like image 81
callmebob Avatar answered Oct 05 '22 09:10

callmebob


Use CTRL+D at each line and it will find the matching words and select them then you can use multiple cursors.

You can also use find to find all the occurrences and then it would be multiple cursors too.

like image 38
Akar Avatar answered Oct 05 '22 09:10

Akar