Auto-hides tabs panel when a single tab is present, and allows you to set a custom keybinding to toggle the tabs panel.
Feel free to test it and modify it as you see fit.
Update: Simplified it a bit, and now it works with panels correctly.
[code]# Remember to set the keybinding:
import sublime, sublimeplugin
def doToggleTabs():
show = 0
for group in range(sublime.activeWindow().numGroups()):
views = len(sublime.activeWindow().viewsInGroup(group))
if views > 1:
show = 1
break
if show == 1:
sublime.options().set(‘showTabs’, True)
else:
sublime.options().set(‘showTabs’, False)
class toggleTabs(sublimeplugin.TextCommand):
def run(self, view, args):
showTabs = sublime.options().get(‘showTabs’)
if showTabs == True:
sublime.options().set(‘showTabs’, False)
else:
sublime.options().set(‘showTabs’, True)
class toggleTabsPlugin(sublimeplugin.Plugin):
def onClose(self, view):
doToggleTabs()
def onActivated(self, view):
doToggleTabs()[/code]
A copy is saved here: pastebin.com/hB1KJSjz