Skip to content

Instantly share code, notes, and snippets.

@lattespirit
Created June 15, 2017 06:50
Show Gist options
  • Save lattespirit/2955299d1c90d9e8ccb92ab4a4175299 to your computer and use it in GitHub Desktop.
Save lattespirit/2955299d1c90d9e8ccb92ab4a4175299 to your computer and use it in GitHub Desktop.
Close Other Tabs in Sublime Text 3
import sublime
import sublime_plugin
class CloseOtherTabsCommand(sublime_plugin.WindowCommand):
def run(self):
active_group = self.window.active_group()
curr_view_id = self.window.active_view_in_group(active_group).id()
for v in self.window.views_in_group(active_group):
if v.id() == curr_view_id: continue
self.window.focus_view(v)
self.window.run_command("close")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment