Created
July 12, 2021 07:01
-
-
Save OdatNurd/9ffced9af1aaa34c6b0463330015539e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| // Toggle the most recently accessed terminus panel open and closed; will | |
| // create a new default panel if there is none currently. | |
| { | |
| "keys": ["alt+`"], | |
| "command": "toggle_terminus_panel" | |
| }, | |
| // You can have multiple bindings to toggle multiple panels, but you must | |
| // specify a panel_name for all of them. | |
| { | |
| "keys": ["alt+`"], | |
| "command": "toggle_terminus_panel", | |
| "args": { | |
| "panel_name": "Terminus" | |
| } | |
| }, | |
| { | |
| "keys": ["ctrl+alt+g"], | |
| "command": "toggle_terminus_panel", | |
| "args": { | |
| "panel_name": "Git" | |
| } | |
| }, | |
| // Close the current terminal; works only in a terminus panel or view. | |
| // You could also bind this to ctrl+w, which is the default key for | |
| // closing a tab. | |
| { | |
| "keys": ["ctrl+d"], | |
| "command": "terminus_close", | |
| "context": [ | |
| { "key": "terminus_view"} | |
| ] | |
| } | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sublime | |
| import sublime_plugin | |
| import os | |
| class OpenInTerminusCommand(sublime_plugin.WindowCommand): | |
| """ | |
| Drop in replacement for terminus_open that will open the | |
| """ | |
| def run(self, dirs, panel=True, **kwargs): | |
| command = "terminus_open" | |
| kwargs["cwd"] = dirs[0] | |
| if panel: | |
| command = "toggle_terminus_panel" | |
| kwargs["panel_name"] = "Terminus: %s" % os.path.split(dirs[0])[-1] | |
| self.window.run_command(command, kwargs) | |
| def is_enabled(self, dirs, panel=True): | |
| return len(dirs) == 1 | |
| def is_visible(self, dirs, panel=True): | |
| return len(dirs) == 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "target": "terminus_open", | |
| // So terminus will re-use the same tab | |
| "tag": "python", | |
| // Provide a tab title | |
| "title": "Python Custom", | |
| // Don't auto-close the tab when the program ends | |
| "auto_close": false, | |
| "timeit": true, | |
| // Make sure that no other tabs are selected, then select the tab to the | |
| // left to create the window split. | |
| "post_window_hooks": [ | |
| ["unselect_others"], | |
| ["select_to_left"] | |
| ], | |
| "cmd": ["python3", "-u", "$file"], | |
| "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", | |
| "selector": "source.python", | |
| "env": {"PYTHONIOENCODING": "utf-8"}, | |
| "windows": { | |
| "cmd": ["py", "-u", "$file"], | |
| }, | |
| "variants": | |
| [ | |
| { | |
| "name": "Syntax Check", | |
| "cmd": ["python3", "-m", "py_compile", "$file"], | |
| "windows": { | |
| "cmd": ["py", "-m", "py_compile", "$file"], | |
| } | |
| } | |
| ] | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
These are the sample files referenced in the video containing Power Tips for Terminus available from my YouTube Channel.
The video demonstrates being able to toggle multiple Terminus panels, open Terminus from the side bar, and using Sublime Text's new Tab MultiSelect feature to easily get a split build with Terminus.