I am very new to Sublime Text and I am sure this is a naive question. Watching the Multiple line selection at http://www.sublimetext.com/ (2/6 slide). Absolutely love it.
I understand that Ctrl (Cmd)+Shift+L "multiple-selects" so that we could do the edit simultaneously. However, in the demo, they also merge all the lines into 1 single line. What is the shortcut for that?
I used Ctrl+J but it just deletes once and not all the occurrences of new line.
I use TextPad and use Find/Replace \n
with an empty space. But it seems that the person giving the demo uses some kind of shortcut.
The paste command can merge lines from multiple input files. By default, it merges lines in a way that entries in the first column belong to the first file, those in the second column are for the second file, and so on. The -s option can let it merge lines row-wise.
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.
To add single-line comments, put the text cursor on the line to comment-out or highlight multiple lines and type CMD + / on Mac, for Linux and Windows use CTRL + / .
Select the lines & press Ctrl + J --> Easiest option :) On small structures, manual method is often quicker and more effective than elaborated (programmatic) one.
A single command shortcut for merging multiple lines into 1 is "join lines".
Important note: This keyboard shortcut changed in versions of sublime text released after around mid-2021. For older versions, use Command + J, or CTRL + J.
Another approach is seen in the demo animations on sublimetext.com. Using multiple selections, Ctrl+Shift+L is used to split a selection into lines, and each line is then edited simultaneously. end + del will then remove all line breaks. This can be seen in slide 2/6 at http://sublimetexttips.com/7-handy-text-manipulation-tricks-sublime-text-2/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With