Skip to content

Instantly share code, notes, and snippets.

@OdatNurd
Created March 4, 2021 23:16
Show Gist options
  • Select an option

  • Save OdatNurd/db3541e64a3d0a457e543aa9d98c6838 to your computer and use it in GitHub Desktop.

Select an option

Save OdatNurd/db3541e64a3d0a457e543aa9d98c6838 to your computer and use it in GitHub Desktop.

Revisions

  1. OdatNurd created this gist Mar 4, 2021.
    36 changes: 36 additions & 0 deletions Default (PLATFORM).sublime-keymap
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    [
    // If you use the Chain of Command package, use this binding to chain
    // the two required commands together.
    { "keys": ["ctrl+shift+h"], "command": "chain",
    "args": {
    "commands": [
    ["terminus_close"],
    ["destroy_pane", {"direction": "self"}]
    ]
    },
    "context": [{ "key": "terminus_view"}]
    },

    // If you use the Multicommand package, use this binding to chain the
    // two required commands together.
    { "keys": ["ctrl+shift+h"], "command": "multicommand",
    "args": {
    "commands": [
    {
    "command": "terminus_close"
    },
    {
    "command": "destroy_pane",
    "args": {"direction": "self"}
    }
    ]
    },
    "context": [{ "key": "terminus_view"}]
    },

    // If you don't use either package, then you can install the sample plugin
    // and use a binding like this to do the same thing.
    { "keys": ["ctrl+shift+h"], "command": "close_and_destroy",
    "context": [{ "key": "terminus_view"}]
    },
    ]
    12 changes: 12 additions & 0 deletions close_and_destroy.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    import sublime
    import sublime_plugin


    class CloseAndDestroyCommand(sublime_plugin.WindowCommand):
    """
    Implement a close_and_destroy command which will close the current
    terminus view and then destroy the origami pane that it's inside of.
    """
    def run(self):
    self.window.run_command("terminus_close");
    self.window.run_command("destroy_pane", {"direction": "self"})