Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>Remove empty linesNew to Visual Studio Code? Get it now.

Remove empty lines

Alexander

|
22,644 installs
| (5) | Free
Remove blank lines from document or selection.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Provides 2 commands

  • remove-empty-lines.inDocument
  • remove-empty-lines.inSelection - can be used without selection (will remove all adjacent empty lines)

demo

Settings

  • remove-empty-lines.allowedNumberOfEmptyLines

Example: "remove-empty-lines.allowedNumberOfEmptyLines": 1,

demo_allowed_lines

⚠⚠⚠ Extension doesn't define any keyboard shortcuts

📚 How to open keybindings.json =======>

DEMO: Pass allowed number of empty lines as arguments in keybindings.json

{
	"key": "ctrl+shift+9",
	"command": "remove-empty-lines.inDocument",
	"args": 0
},
{
	"key": "ctrl+shift+9",
	"command": "remove-empty-lines.inSelection",
	"when": "editorHasSelection",
	"args": 0
},
{
	"key": "ctrl+shift+8",
	"command": "remove-empty-lines.inDocument",
	"args": 1
},
{
	"key": "ctrl+shift+8",
	"command": "remove-empty-lines.inSelection",
	"when": "editorHasSelection",
	"args": 1
},
  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2021 Microsoft