talira

Trailing Spaces

Highlight trailing whitespace in VS Code and delete it in one go

open sourceMITfree

A Visual Studio Code extension by Shardul Mahadik that highlights trailing spaces and deletes them, in the whole file or only on modified lines, on demand or on save. Options include live or on-demand matching, empty lines, the current line, ignoring some languages or schemes, and the highlight's colors. A port of the Sublime Text plugin of the same name. MIT licensed.

Problems it solves

  • stray whitespace at the end of lines keeps showing up in my diffs
  • see and remove trailing spaces before I commit
  • strip trailing whitespace only on the lines I changed

Features

  • highlight trailing spaces
  • delete them in the file or on modified lines only
  • trim on save
  • live or on-demand matching
  • ignore chosen languages and schemes
  • custom highlight colors