Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>Selective Trailing TrimNew to Visual Studio Code? Get it now.
Selective Trailing Trim

Selective Trailing Trim

Isnandar Fajar Pangestu

| (0) | Free
Selectively trim trailing whitespace in your VS Code workspace based on cursor positions or manually on all lines, without destroying full file formatting.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Selective Trailing Trim

A VS Code extension to surgically trim trailing whitespace. Instead of trimming trailing whitespace globally across your entire file (and polluting your version control), you can target only specific lines seamlessly!

Features

  • Trim Trailing Whitespace Selected Lines: Select a few lines (or just place your cursor anywhere on a line) to delete trailing whitespaces only on those lines.
  • Trim Trailing Whitespace All Lines: Safely trims trailing whitespaces across the entire document without resetting cursor jumps.

Demo

Demo of Selective Trailing Trim

Installation

You can install this extension directly from your preferred marketplace:

  • VS Code Marketplace
  • Open VSX Registry

Alternatively, search for "Selective Trailing Trim" in your VS Code Extensions tab.

Development

Interested in contributing to or developing this extension locally? Please check out the Development Guide.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft