For when you've just made a commit and you want to quickly close any files that are no longer modified.
Currently the API doesn't really support this sort of thing, so this is basically a nasty hack based on a suggestion by Eric Amodio in a vscode issue.
It runs through your current open editors and closes any that are unmodified in git. This obviously depends on having git installed.
Doesn't cope very well if only one file is currently open. It will also fail if it comes across an opened image, or editors without a document, like the Code welcome page. For some reason, the API doesn't provide any way to detect when this has happened. Any suggestions gratefully received!
Adds an explorer context menu entry 'Close unmodified editors', or you can bind a key to 'extension.closeUnmodifiedEditors'...
You can install the latest version of the extension via the Visual Studio Marketplace here.
Alternatively, open Visual Studio code, press Ctrl+P
or Cmd+P
and type:
> ext install closeunmodified
The source code is available on GitHub here.