Sublime Forum

Simple View/Window Template?

#1

Hi,
I’m starting development of a new debugger plugin for ST and unsure where to start.

I have looked at some other plugins that have more complex views/windows, but am hoping to find some sort of clean tutorial or template for views with tabs, etc. to start my development from as an example.

Any suggestions appreciated. I have already looked at the tutsplus tutorial, but it doesn’t include much on views.

Thanks!

0 Likes

#2

Bump. Anybody?

Given how awesome ST is and how many people making plugins it seems odd there’s so few tutorials or examples :frowning:

0 Likes

#3

If possible, can you expand on what you are trying to do with the windows/views. Most developers explore other plugins or just experiment. That being said, I’m sure new plugin developers such as yourself would like to see more tutorials related to ST and plugins. Just have to get someone to spend the time doing it I suppose.

0 Likes

#4

As mentioned in the original post, I’d like to make a new debugger for ST. It needs multiple tabs, split views for stack traces, watch variables, etc. I was hoping to setup a clean/robust multi-file template to work from. I have domain expertise in writing the debugger side, but not in gluing this to ST in a robust and efficient way with few examples to go by except picking apart other people’s plugins to see how they did things.

For example, I saw that GoGdb uses a file called “GoGdb.sublime-settings” to encode some layouts with rows and columns. Is this a recommended way to setup views and other variables? Be great to see an official example of using the various types of files ST recognizes.

I guess I was thinking some simple templates for ST plugins that cover the main use-cases would be nice as a starting point. Once somebody is an expert, there’s of course a dozen ways to do something. It would be nice though to be given complete examples of one way to do something that can be built upon.

But back to my original post, any simple example you could give me to understand the layout and plumbing for more complex ST plugins?

Thanks!

0 Likes

#5

Yes, setting the layout will consist of something similar to this.

   {
	"keys": "super+alt+1"],
	"command": "set_layout",
	"args":
	{
		"cols": [0.0, 1.0],
		"rows": [0.0, 1.0],
		"cells": [0, 0, 1, 1]]
	}
}

The cols, rows, and cells define what the window will look like. I haven’t done much with layouts before, so I can’t help you much there. The *.sublime-settings files store settings relevant to a given plugin. You specify the name of this plugin when you run sublime#load_settings. I’ll see if I can come up with some additional plugins that may help you. Feel free to ask more questions. There are no notifications on this forum, so you may also want to try posting on stack overflow. I know there are a handful of ST plugin developers who watch those tags.

If you haven’t already, you msay want to take a look at code.tutsplus.com/tutorials/how- … -net-22685. While it doesn’t cover everything, it’s not a bad starting place for getting acquainted with ST plugins. As that tutorial was written for ST2, it may not work in ST3. If that’s the case, you can grab a version of ST2 to go through the tutorial, or try to figure it out yourself. There aren’t many changes between ST2 and ST3, but those are relatively easy to explain if you are familiar with ST2 plugins.

0 Likes