<menu>
<item caption="Close Tab" command="closeUnder"/>
<item caption="Close Other Tabs" command="closeAllExceptUnder"/>
<item caption="Close Tabs to the Right" command="closeToRightOfUnder"/>
<item caption="Close All" command="closeAll"/>
<separator/>
<item caption="Save" command="saveUnder"/>
<separator/>
<item caption="New view into %s" command="cloneUnder"/>
<separator/>
<item caption="Buffer Name..." command="editBufferNameUnder"/>
</menu>
<!--
Place your key bindings in here, this will ensure they don't get overwritten
when installing new versions of Sublime Text
-->
<bindings>
....
<binding key="ctrl+alt+w" command="closeAllExceptUnder"/>
</bindings>
# tab_management.py
class CloseAllOtherTabsCommand(sublimeplugin.WindowCommand):
def run(self, window, args):
active_group = window.activeGroup()
curr_view_id = window.activeViewInGroup(active_group).id()
for v in window.viewsInGroup(active_group):
if v.id() == curr_view_id: continue
window.focusView(v)
window.runCommand("close")<binding key="ctrl+t" command="closeAllOtherTabs"/>import sublime, sublimeplugin
# tab_management.py
class CloseAllOtherTabsCommand(sublimeplugin.TextCommand):
def run(self, window, args):
active_group = window.activeGroup()
curr_view_id = window.activeViewInGroup(active_group).id()
for v in window.viewsInGroup(active_group):
if v.id() == curr_view_id: continue
window.focusView(v)
window.runCommand("close")
Users browsing this forum: francescob, Google [Bot] and 11 guests