Skip to content

A Visual Studio Code extension to close open editors which are not modified in git

Notifications You must be signed in to change notification settings

Gruntfuggly/closeunmodified

Repository files navigation

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.

About

A Visual Studio Code extension to close open editors which are not modified in git

Resources

Stars

Watchers

Forks

Packages

No packages published