Split lines on spaces in Sublime Text
Asked Answered
S

3

20

How can i split lines in Sublime Text 3? I tried ctrl+t, ctrl+x

but it does not work.

I have line such as

this is a sentence

i would like to make it

this
is
a
sentence
Stepsister answered 16/3, 2015 at 18:52 Comment(0)
D
34

I always use Ctrl + H (Replace), enable the Regular Expression match (Alt + R) and then execute a replace all on " " to "\n".

Detumescence answered 16/3, 2015 at 18:55 Comment(3)
Replacing with "\n" just inserts the "\n" characters. Am I missing something?Airhead
@Airhead You need to enable the Regular Expressions match (Alt + R or the top-left .* button).Detumescence
Cool, that worked flawlessly. I used it to separate a comma delimited list into lines for pasting into excel. Search and replace ", " with \n.Cockspur
O
20

for Mac, select the first space between "this" and "is" then press command+d to select the same pattern in the file, then press enter~

Outofdate answered 7/7, 2017 at 14:24 Comment(2)
Also good and easy solution for Windows using ctrl+d instead of command+d.Georgeanngeorgeanna
for Mac, ⌃ + ⌘ + G Select all occurrences of current selection ,then enterOho
I
8

https://forum.sublimetext.com/t/split-into-lines/10196/5

Hilight your space, press Alt+F3 (windows) to select all, hit return.

Inclement answered 24/8, 2017 at 12:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.