Sublime Forum

New plugin idea

#1

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.

0 Likes

#2

Regarding pointers on Sublime Text plugin development, I have a [https://youtube.com/playlist?list=PLGfKZJVuHW91zln4ADyZA3sxGEmq32Wse](http://video series on YouTube) that covers it.

However, with that said, if your intention is to augment the user interface of Sublime in some fashion, that’s not possible (except via themes, which can do things like change the colors and images used to represent thing).

The UI in Sublime is controlled purely by the core (that is, unlike say VSC which is just a web application packaged into it’s own electron wrapper application, Sublime is a native app and isn’t modifiable in that manner).

0 Likes

#3

@Inkt @OdatNurd, I saw this yesterday. Would it be possible to recreate it in Sublime Text?

0 Likes

#4

Visualized like that? Most likely not; it would need to be constrained by Sublime’s existing UI and reimagined around that. In all likelyhood that would revolve around just having a list of files that you’ve recently edited that you can jump to, which is already possible via Sublime using Goto Anything, or a package could track what’s being opened and closed and put them in a list.

I don’t know if the idea has any merit if it’s not going to visually show you file contents and flip through them like a timeline, though.

0 Likes