Walid-Shouman
5/23/2017 - 8:04 AM

Sublime customization

Sublime customization

How to write my own functionality

Following is an example

Close project and allow saving tabs

For that to work we need to save close and reopen the project without closing the window

import sublime
import sublime_plugin


class CloseProjectAndExitCommand(sublime_plugin.WindowCommand):
    def run(self):
        self.window.run_command("close_project")
        self.window.run_command("close_window")

and add your favorite shortcut to the keymap

{ "keys": ["ctrl+alt+shift+k"], "command": "close_project_and_exit" }

Note: Only closing the whole thread will retrieve it's open windows upon reopening Sublime

SO answer
Reference from Sublime website