Sublime Forum

Snippet orgainizer for ST

#1

hello,

Does anyone know of an application to organize sublime text snippets? Similar to cacher, but I don’t want to change the way ST works with snippets (trigger, scopes, etc).

thank you

0 Likes

#2

I don’t have any suggestions for this, but there are numerous plugins which make adding / creating and managing snippets from within Sublime Text… This combined with a bat file and Dropbox is a very easy and efficient way to go. What I mean, is to create a Plugin directory, the structure of one anyways, in Dropbox and a BatFile to create symbolic / hard link in the application data directory of the pc it is installed on… From there, you run it on any computer you newly install Sublime Text on - then you have an easy way to manage your snippets and you can create a plugin folder for each language, or have them all nested within - they should be loaded into memory automatically regardless of the folder as Sublime Text likes to auto-run files in Plugins…

Another option, is to use that in conjunction with any number of those plugins which won’t change how you trigger the snippet, the scope they work within, etc…

Another option is my plugin: AcecoolCodeMappingSystem - This is currently unrelated but version 1.0.0 is coming out soon and will include a dynamic paneling system ( which can be used in a window by itself, or in any window you want to use it in ) and will include a snippets category which can be put in any panel. This will list all of the snippets available to you for the current file you’re working on and a simple click, or double click ( your choice ) will trigger it, alternatively I may be able to show the hotkeys bound to the snippet for easy remembering and triggering without removing your hand off the keyboard.

My plugin doesn’t currently have this support - right now it boils away all of the code except what is deemed important, to create quick-links such as function names, class definitions, notes / tasks lists, and more with plenty of callbacks and mapping capabilities to refine what is looked for so your project can map AccessorFunctions calls into an entry for each function created and more.

I’m also planning on adding support for macros, urls, bookmarks, wikis ( which will be shown via on_hover dialog ) and more.

It may already be on Package Control - I submitted an application. I am also working on Threaded access to prevent locking the UI thread - for some reason the threading system isn’t working so I’m going through it all.

1 Like

#3

thank you for these suggestions. I thought of making a script myself to synchronize my snippets between ST and a snippet viewer. I’ll need to see how well that works for me (never used snippet manager before, I am testing several applications) That plugin might be a good alternative to what I am planning to do, though, as it can provide a good overview and preview of my snippets.

0 Likes

#4

I’ll see about implementing the functionality ASAP. I am still working on threading and a few other things and exploring other options to increase the speed that it takes to map large files… Right now I haven’t been able to get all of the symbols to show up automatically using * so either I have to pre-define them all, then since it is handled by Sublime in the background thread it’ll be a lot faster - or I’ll be stuck with the current solution and try to work on the threading solution - I am going to be building another plugin as a mock up of this one with threading in mind and porting the code over so see about isolating the exact point of failure / lag… Even though Sublime Developer tools tells me it takes 0.01 or so seconds, I know it is taking more time when not loading from a cached file…

I’ll make sure to add the Snippets category and see about loading existing snippets, and creating a command so if it is clicked in the panel, it’ll execute where the cursor was in the main view. Also, because of all the callbacks, etc… it shouldn’t be a problem to show examples of the snippet instead of just the title which can be helpful especially if you switch between as many languages as I do…

I just wanted to post to let you know that I haven’t forgotten about this.

1 Like