Ignore whitespace in Visual Studio Code git diff view
42,582
Solution 1
I believe OP is asking to ignore all whitespaces (including between words) not just trailing whitespaces.
Unfortunately, it's still not implemented and you can track the process status here: https://github.com/Microsoft/vscode/issues/43026
Solution 2
Add on your settings.json
:
"diffEditor.ignoreTrimWhitespace": true,
Related videos on Youtube

Author by
darKnight
Updated on July 08, 2022Comments
-
darKnight 6 months
Is it possible to ignore white-space when viewing code differences of a file (generated by GIT) in Visual Studio Code? That will be really helpful in checking for actual code additions/deletions before committing.
-
darKnight almost 6 yearsEDIT: I found that this setting only controls if the diff editor shows changes in leading or trailing whitespace as diffs. It does not consider whitespaces in-between the same line. I want the diff editor to ignore all the whitespace in the code, not just leading and ending whitespace of a line.
-
Dave over 3 yearsIt's also available in Preferences,Settings.
-
Bernardo Dal Corno about 3 yearsdoesn't affect leading whitespace
-
Tal Segal almost 3 yearsFile => Preferences => Settings => Diff Editor => Ignore Trim Whitespace.
-
aroon65 over 1 yearNot sure when it was added, but there's an icon to toggle this at the top of the diff document pane now.
-
Devin Rhode 9 monthswhitespace toggle button looks like this: ¶