Skip to content

Instantly share code, notes, and snippets.

@kostyay
Created January 9, 2023 09:44
Show Gist options
  • Save kostyay/84ab4d1962481d443a6718210be5c448 to your computer and use it in GitHub Desktop.
Save kostyay/84ab4d1962481d443a6718210be5c448 to your computer and use it in GitHub Desktop.
Sublime 3 Close All Windows without saving
# This will close all views (files open in specific window) without asking to save them
# You can register it to a keyboard shorcut using this snippet
# {"keys": ["ctrl+shift+q"], "command": "close_without_saving"}
import sublime
import sublime_plugin
class CloseWithoutSaving(sublime_plugin.WindowCommand):
def run(self):
window = self.window
for v in window.views():
print ("Closing %s" % v.file_name ())
v.set_scratch(True)
v.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment