A GitHub Whitespace Shortcut!

Krys Flores
Lob Developers
Published in
2 min readApr 1, 2022

As an engineer, I like to do things in as few steps as possible. If I can automate something, I will. However, one day I was complaining to my boss Ross about GitHub PRs and whitespaces.

It takes me three clicks to remove the whitespace from any PR. That’s at least two clicks too many in my opinion.

To ease my aching hand — and erase the black mark inefficiency leaves on my soul — my boss Ross showed me this little bookmark he made:

Voila! With one click, I could get rid of all the whitespace in a PR and focus on the code I actually wanted to (i.e., functionality that changed).

How to add this shortcut

  1. Create a new bookmark. You can name it `github whitespace` or whatever you like.
  2. Edit your new bookmark.
  3. Add the following JavaScript script which will add the remove whitespace command to your window: javascript: (() => { window.location += ‘?w=1%27; })();

4. Save your bookmark.

5. Go to a Github PR with a ton of whitespace changes.

6. Click on your bookmark.

7. Witness the magic!

--

--

Krys Flores
Lob Developers
0 Followers
Writer for

AI questions? I got you. Formerly Staff Engineer @Carta and @Lob. Self-taught. #togetherWeGoFar