I am a long time webdev, experienced in serveral lanuages, and long time sublime fan. I usually have ~20 files opened, this makes my tab bar pretty crazy. Ive been looking for a way to tame this down. I checked out some of the available solutions, and none really fit my needs, or havent come across one anyways. I thought to myself, I am a programmer, albeit different languages, but I can and am willing to learn.
My idea is to have the tabs dragable and sortable, more importantly, divided into multiple rows. My thinking is to create a wrapper, look through all the tabs, then style with some basic css.
Here is my code to far…
import sublime import sublime_plugin import os import tab import sys class advancedTabs(): def run(self, edit): window = sublime.active_window() views = window.views() advancedTabs = '<div id="tabWrapper">' for view in views: advancedTabs += make_tab(os.path.abspath(view.file_name()), view.file_name()) advancedTabs += '</div>' print(advancedTabs) def make_tab(path, name): individualTab = '<div class="tab">' individualTab += '<a href="'+path+'">'+name+'</a>' individualTab = '<div class="tabClose">X</div>' individualTab += '</div>' return individualTab
Specifically I’m curious about how I might target, and write to a specific UI region(namely the tab bar). Does python accept html/css? How do I concatinate a string? Any pointers on sublime plugin developement would be awesome.