Sublime Text 2: How to delete blank/empty lines
sublimetext2
Solution
Select the text
Press:
- Ctrl + H on PC, or
- command + option + F on Mac or
- Click Find->Replace.
Make sure you have selected 'regular expression' by pressing:
- Alt + R on PC or
- command + option + R on Mac or
- Click .* in the Find box.
Find what: `^\n` or `^(\r|\n\r?)`
Replace With: (nothing, leave in blank).
Problem
Let's say I had a text file with the following nine lines: ``` foo bar baz qux quux ``` How can I use Sublime Text 2 to remove all four of the blank/empty lines, leaving only five lines?