Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Close UnmodifiedNew to Visual Studio Code? Get it now.
Close Unmodified

Close Unmodified

Gruntfuggly

|
2,316 installs
| (3) | Free
Close files which aren't modified in git
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Close Unmodified

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!

Operation

Adds an explorer context menu entry 'Close unmodified editors', or you can bind a key to 'extension.closeUnmodifiedEditors'...

Installing

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

Source Code

The source code is available on GitHub here.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft