Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode: How do I KEEP blank lines (in scss files or others)?

VSCode deletes empty lines by default in certain cases, but what if I want to preserve/keep blank/empty lines in a document? For example, in my .scss file, I want to keep the blank lines that I made in between nested styles within a parent between properties and children, but "Format Document" keeps removing them. How can I tell VSCode to not remove any blank lines that I make? It seems to keep them for other file types.

like image 957
Steven Choi Avatar asked Sep 05 '25 03:09

Steven Choi


1 Answers

For example, in my .scss file, I want to keep the blank lines that I made in between nested styles

You can tryout the extension Beautify

  • Download it through VSCode's Extensions Manager.
  • Once installed, from the top menu select Go -> Go to File...
  • In the command line type, >b
  • You should then see an command for Beautify File
  • Click it. It should format your opened .SCSS file and preserve the blank spaces between each CSS rule set (if they were there already).
like image 69
klewis Avatar answered Sep 08 '25 12:09

klewis