Skip to content

Instantly share code, notes, and snippets.

@UltraInstinct05
Created October 19, 2021 12:25
Show Gist options
  • Save UltraInstinct05/5766e6a8a4bb51cf7e481c19014a847a to your computer and use it in GitHub Desktop.
Save UltraInstinct05/5766e6a8a4bb51cf7e481c19014a847a to your computer and use it in GitHub Desktop.
To open any folder in a new window.
import sublime
import sublime_plugin
class OpenFolderInNewWindowCommand(sublime_plugin.WindowCommand):
def run(self, paths):
if not os.path.exists(paths[0]):
return
self.window.run_command("new_window")
window = sublime.active_window()
window.set_project_data({
"folders": [{ "path": paths[0] }]
})
[
{
"caption": "Open in New Window",
"command": "open_folder_in_new_window",
"args": {
"paths": []
},
},
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment