Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ashishjullia/c41513f5321490ec4cfad74d0c873203 to your computer and use it in GitHub Desktop.
Save ashishjullia/c41513f5321490ec4cfad74d0c873203 to your computer and use it in GitHub Desktop.
visual-studio-code-remove-blank-lines-from-code

You can use regular expressions.

  1. Open your code in Visual Studio Code
  2. From Edit Menu, select Replace or use a short cut key (command + Option + F on Mac or Ctrl + H on Windows)
  3. In the find box type ^(\s)*$\n
  4. Leave the replace box empty
  5. Make sure the 'Use Regular Expression' is selected
  6. Select the 'Replace All' button

image

Ref: https://stackoverflow.com/a/67601889

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment