Delete Blank Lines for VS Code
A VS Code extension inspired by Emacs' delete-blank-lines
command.
Trim multiple consecutive blank lines.

Features
Trim Blank Lines / Delete Blank Lines
- Behavior:
- Cursor on a blank line: collapses contiguous blank lines to one.
- If the blank line is isolated, deletes it.
- Cursor on a non-blank line: deletes all immediately following blank lines.
Delete consecutive blank lines

If there is just only one blank line, delete it.

On a non empty line, delete all blank lines under

Cut Line to Clipboard
- Behavior:
- Cuts the current line including newline.

Commands & Keybindings
Function |
Command |
Keybinding |
Description |
Trim / Delete Blank Lines |
delete-blank-lines-for-vscode.trim |
Ctrl+Shift+Backspace |
Trim blank lines around cursor: collapse blocks or remove isolated blank lines. |
Cut Line to Clipboard |
delete-blank-lines-for-vscode.cutLine |
Shift+Backspace |
Cut current line and append to clipboard if consecutive. |
Note: The “Trim Blank Lines” and “Delete Blank Lines” commands are the same function.
Commands & Keybindings
Function |
Command |
Keybinding |
Delete Blank Lines |
delete-blank-lines-for-vscode.trim |
Ctrl+Shift+Backspace |
Trim Blank Lines |
delete-blank-lines-for-vscode.trim |
Ctrl+Shift+Backspace |
Cut Line to Clipboard |
delete-blank-lines-for-vscode.cutLine |
Shift+Backspace |
⚠️ Note:
“Trim Blank Lines” and “Delete Blank Lines” are two labels for the same function.
Both uses delete-blank-lines-for-vscode.trim
for their implementation.
Trim Blank Lines / Delete Blank Lines
Collapses contiguous blank lines into one, deletes isolated blank lines, or removes all immediately following blank lines if the cursor is on a non-blank line.
Cut Line to Clipboard
Cuts the current line and copies it to the clipboard.
Installation
- Open VS Code.
- Go to Extensions (
Cmd+Shift+X
).
- Search for Delete Blank Lines for VS Code.
- Click Install.
- Use the commands via keyboard shortcuts or Command Palette.