All posts

Trim trailing spaces using VScode


To achieve this desired outcome, first install the trailing spaces extension.

After that is installed, open VScode commands (mac shortcut I use is cmd+shift+p) and navigate to Preferences: Open User Settings. When you select this a settings.json file will be displayed.

Add this to the object:

"trailing-spaces.trimOnSave": true

Or if this is your first update to the file create the whole object:

{"trailing-spaces.trimOnSave": true}

Now all that’s left to do is give it a try.


I built two products to help fund continued efforts for this website, it would mean a lot if you would check them out:
1. 2500+ Words for the Undermotivated Software Engineer - A short essay I wrote on the titled topic ($3).
2. Build 3 Chrome Extensions in Under 2 Hours - A course I built to teach chrome extension development ($9-20).