Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Trailing WhitespaceNew to Visual Studio Code? Get it now.
Trailing Whitespace

Trailing Whitespace

jkiviluoto

|
50,221 installs
| (4) | Free
Highlight and remove trailing whitespaces the right way!
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Trailing Whitespace (TWS)

Highlight and trim trailing whitespace.

Features

All trailing whitespace can be decorated with red highlight. Trailing whitespace can be trimmed upon saving the file, but only from lines user has modified.

Extension Settings

This extension contributes the following settings, all machine-overridable:

  • tws.trimOnSave: enable/disable trimming the whitespace when saving document
  • tws.highlightTrailingWhiteSpace: enable/disable highlighting of trailing whitespace
  • tws.highlightOnlyChangedLines: enable/disable highlighting of trailing whitespace only on changed lines
  • tws.debugLog: enable/disable debug log channel

References

  • jsdiff is used to find modified lines
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft