How can I remove a line break and all spaces on the next line in the Sublime Text editor?

  1. open Search and replace (CTRL+H)
  2. enable “Regular Expression” (circled in red)
  3. enter \n\s+ in the search field, clear the replace field
  4. press “Replace all”

enter image description here

This will remove all newlines (\n+) followed by all whitespace (\s+) in the next line.

Leave a Comment