In Sublime Text 3: is there a shortcut to delete blank lines in the selected text? (same for spaces in a line)

My question is very simple:

Is there a shortcut in Sublime Text 3 that allows you to delete blank lines in the selected text? (same for spaces in a line)

For example, how to make this text:

a

b

c

To become:

a
b
c

And this line:

I need to remove these blanks.

to become this line:

Ineedtoremovetheseblanks.

+4
source share
3 answers

You don’t need a plugin for this, just search and replace regular expressions. First, select the text in which you want to delete blank lines. Then select (or click on Windows / Linux, on OS X). Make sure that the "Regular Expression" and "In Selection" buttons are selected: Find → Replace…Ctrl H F

find / replace dialog

Find What: ^\n , Replace With: . " " :

before replacing

:

after replacement

^\n (^), (\n). , "" , , ^\s*\n - \s* 0 , .

Find/Replace, , , \s*.

+4

, , .

DeleteBlankLines, Sublime Text 3, , , .

:

https://packagecontrol.io/packages/DeleteBlankLines

+1

Trimmer. .

, , . , ( , ), :

1) > >

2) > >

, , , .

+1

Source: https://habr.com/ru/post/1665901/


All Articles