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,
Share:
42,582

Related videos on Youtube

darKnight
Author by

darKnight

Updated on July 08, 2022

Comments

  • darKnight
    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
    darKnight almost 6 years
    EDIT: 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
    Dave over 3 years
    It's also available in Preferences,Settings.
  • Bernardo Dal Corno
    Bernardo Dal Corno about 3 years
    doesn't affect leading whitespace
  • Tal Segal almost 3 years
    File => Preferences => Settings => Diff Editor => Ignore Trim Whitespace.
  • aroon65 over 1 year
    Not sure when it was added, but there's an icon to toggle this at the top of the diff document pane now.
  • Devin Rhode
    Devin Rhode 9 months
    whitespace toggle button looks like this: ¶