Sublime Forum

Feature Request: User-build addins

#1

Consider three apps that benefit massively from a plugin system;

  • Firefox
  • Eclipse
  • emacs

Each of them has ā€˜come to powerā€™ because power users can hack the program to work as they really like. The basic system just provides hooks and programmers can extend the app to work well in particular, specialised ways.

Sublime Text already has python and macro extensions, but right now there is little documentation and no way, AFAIK, to deploy new addins ā€“ new command sets, themes, macros, language definitions, etc.

Possibly, if good addins appear, and they become popular, the features could be woven back into Sublime. Itā€™s a mechanism for users to experiment without overloading Jon with feature requests, and seeing what sticks.

Key features would be;

  • package up all necessary files into a single package (like XUL, JAR)
  • web repository for new packages
  • Tools | Addins menu item for managing new addins.

A massive feature, I know, but I thought Iā€™d see if others are interested in developing for ST.

Hereā€™s a link to the most popular firefox plugins, as background.

addons.mozilla.org/en-US/firefo ā€¦ rt:popular

0 Likes

Updating Sublime and Keeping your customizations intact
#2

Agreed 100%

This is in there partially via the *.sublime-package files, but thereā€™s no reasonable way to distribute them.

When you install Sublime Text, a bunch of *.sublime-package files get added to C:\Program Files\Sublime Text\Pristine Packages. Each of these is just a simple zip file.

When you run Sublime, it compares all these packages with the ones currently in:
C:\Documents and Settings<username>\Application Data\Sublime Text\Pristine Packages

Each new or modified package gets installed, also to the Application Data directory, but under the Packages folder. The basic process of upgrading/installing a package is to compare all the files in the old vs. new ones, and replace the on disk versions. Files in the older package but not the newer are removed.

Whatā€™s missing here is the ability for packages to be installed without them having to first be under Program Files\Sublime Text\Pristine Packages - the plan is that eventually youā€™ll just be able to download additional ones and double click on them in explorer.

Thereā€™s also no easy way to create new packages yet, other than creating a new directory under Application Data\Sublime Text\Packages, and zipping it up.

0 Likes

#3

(For some context for viewers, PackageSetup.py lives in C:\Program Files\Sublime Text and is responsible for installing and upgrading *.sublime-package files)

Youā€™re right: PackageSetup will leave any files you (the user) have changed alone, unless theyā€™ve also been changed in the package, in which case your local changes get nuked. This isnā€™t much fun.

The very first improvement would be to make PackageSetup.py backup any files changed by the user, so worst case nothing is lost. This would be a huge improvement over the situation today.

The next thing that could be done is to try and do a 3 way merge between the old package file, the new package file, and the users changes. Some (much) earlier versions of Sublime did this (with the assistance of code.google.com/p/google-diff-match-patch/), but that wasnā€™t conservative enough, and would try and merge conflicting changes, resulting in broken files.

Any merging must err on the side of caution in merging near-by changes, otherwise thereā€™s a chance that the resulting file wonā€™t be valid, and the user will end up with a broken installation - this is even less fun than losing your customisation to that file.

Iā€™m not keen on making PackageSetup work via a version control tool, just because of the added complexity. However, as an individual, thereā€™s no reason not to put the C:\Documents and Settings<username>\Application Data\Sublime Text\Packages directory under version control.

Actually, using some sort of VCS as the backbone of PackageSetup may not be a bad idea at all, as long as users are never expected to merge anything manually.

0 Likes

#4

Iā€™m tempted to try to get something up, but something very, very simple. Jon is likely to want the option of taking control of something like an add-in repository, and the more complex it is, the harder it will be for him to take over.

Iā€™d prefer to start by dumping zip files on arbitrary FTP servers, and then telling people about them via the forum. Simple enough to start with. Also the way firefox does itā€¦ Source control is then up to the individual developer.

That said, Iā€™m also tempted to put up a simple wiki to share coding tips and such. I may knock something up over the Easter weekend.

0 Likes

#5

Sounds great!

btw sublimator, there is a list of commands at sublimetext.com/docs/commands

0 Likes

#6

One wiki, up and running! nothing impressive yet, but itā€™s a start.

[sublimetextwiki.com](http://www.sublimetextwiki.com)

Itā€™s a moinmoin wiki, which seems to have some good buzz on the interwebs, but Iā€™ve not used it before. Of particular interest is that itā€™s written in python, and I thought that made sense for a python-addin website.

Itā€™s a straightforward installation so far, so weā€™ll see if I can improve it as we go. Itā€™s text-file based, so at some point Iā€™ll be able to chuck a zip file of text files at Jon if he wants it.

0 Likes

#7

Great stuff Steve - just needs some content now :slight_smile:

0 Likes

#8

(speed) Iā€™ve put it on fastcgi, I think, and it feels fast enough now.

(content) Content should now be king. My thought is to get some basic notes about customisation in there ā€“ how do you map a key to a command? How does the macro system work? links to documentation on Jonā€™s site. I think we should be looking at the emacs wiki as a role model. Hereā€™s a link to their mission statement. emacswiki.org/cgi-bin/wiki/MissionStatement

0 Likes

#9

If I understand you right, S, weā€™re talking about the ability to directly load from and save to an ftp server? Thatā€™s something Iā€™d definately want to see. As you say, if we can do it with a plugn/extension/macro/whatever, then Iā€™m very happy with that. Anything to save me from my struggles with vi. :wink:

Did you have a method for doing it yet?

0 Likes

#10

Wiki is looking great - Iā€™ll add a link to in from the Support page.

re: content, tips n tricks, customisation etc are great - Iā€™ll be building the documentation at sublimetext.com into a reference primarily.

re: editing remote files, itā€™s possible to get WinSCP to edit remote files in a standard editor, see winscp.net/eng/docs/task_edit#external_editors

0 Likes

#11

[quote=ā€œsublimatorā€]Right now the priorities as I see them (apart from plugin api):

  1. Notice changes in files
  2. Bracket highlighting[/quote]

I agree with these, though with the addition of an easier way for people to edit basic settings (font etc).

0 Likes

#12

Any possibility of supporting Textmate snippets directly, the way themes are? It would save a lot of work in the long run, I think.

0 Likes

#13

The snippet formats are very similar, itā€™s something that will likely happen.

Thatā€™ll probably be it for TextMate compatibilty though, as things like shell scripting for extensibility (which TM uses heavily) is not something Iā€™m a great believer in, doubly so under Windows.

0 Likes