Sublime Forum

Add "Edit Plugin..." in Tools->Developer, near "Add Plugin..."

#1

ST3.0 Build 3143
MacOS 10.12.6

I have a couple custom plugins, which I only need to edit every few weeks. When I need to edit one of those plugins, it usually takes me a couple minutes to re-discover where the Python script is in the filesystem.

The “Tools->Developer->New Plugin…” menu item is quite easy to find, but “Sublime Text->Preferences->Browse Packages…” isn’t so obviously the place to go to edit plugins.

So, perhaps we could get a new “Edit Plugin…” item nearer to the “New Plugin…” item?

0 Likes

#2

You can edit the main menu by creating a new plugin ( For my random changes I use _Acecool )… In order to add menu entries into existing menus, create Main.sublime-menu and you have to copy the structure EXACTLY…

I can provide you with an example which adds something in each menu ( although I didn’t add all of the nested menus )…

First: Are you aware of the Projects menu? What you do is create a new project, then add a project folder to it - then open up some files and SAVE PROJECT file as My Project Name.sublime-project ( or another ext )…

When you set up your projects this way, you can use a hotkey ( I use F10 )

{ "keys": ["f10"], "command": "prompt_select_workspace" },

which opens up a list of all projects I’ve ever created… If you have hot_exit enabled ( it is by default in preferences ) then when you open a project and add / remove files then close sublime text or switch projects - the project file will auto update… If you accidentally close the project window with a settings window open, your project is still SAFE - the settings window doesn’t overwrite your project window setting - simply reload the project and all of your views will load up normally…

This is an ideal way to revisit old projects as the project folder is already in the sidebar ( or more than 1 folder - I typically set the root of one or more ) with easy access to all of the files… and the tabs are already open to where you were the last time you had that project open…

ALTERNATIVELY - if you want to go the menu route…

Each menu has Acecool added… The help menu has the edit_settings_plus command structure to open up to 16 Sublime Text default configuration files plus the syntax definition file and syntax configuration file…

If you go the menu route - Main.sublime-menu changes require sublime text to restart… but the context menu doesn’t… Create your menu in the context menu and when it is ready, update the main menu system…

If you have DUPLICATE main menu items, it is because you entered the data in the wrong order… for instance you can’t update the help menu before you update the Preferences menu and so on all the way to the first menu… The same goes for nested menus… If you plan on updating more than one, you must go in exact order otherwise you’ll end up either without the custom menu entry, or you’ll end up with duplicate nested menus…

And still on the menu path - if you go this route: I also recommend you look at my plugin announcement for edit_settings_plus… It creates a settings window which can open one to unlimited number of files… You could easily open 50 files only in base or user argument so you don’t end up with a bisected window…

Then you could name your captions: [ Ian.Rees ] Edit MyPluginA, [ Ian.Rees ] Edit MyPluginB, [ Ian.Rees ] Edit MyPluginC
and so on… which when you run the command would open all of the files - and if you add files you could simply edit the command ( either in a python file, or 100% in the menu files )…

Now, the menu structure with the examples in each is here:

2 Likes

#3

The file you provided just opened a totally new frontier for me. I can now think of thousand ways how to use the concept.
Thanks again for sharing! :pray:

0 Likes

#4

Thanks for the thorough response! Yes, I’m aware of the .sublime_menu - my point was more that ST3 provides out-of-the box support for adding new plugins via menus, but the support for editing plugins is somewhat inconsistent with it.

0 Likes

#5

Sure - The default file is in Packages\Default\Main.sublime-menu which will show all of the nested categories, etc…

I made mine because I’ve been wanting to add a new way to add plugin based preferences or… more accurately, make them easier and less tedious to find and use…

It isn’t difficult to go through the default file an delete all of the entries, keeping all of the items with children and then populating the ones you want for your plugin…


This could be something better put towards the Sublime Issues Github forum ( to submit issues or enhancements ) and since they do have one side of the service built - it should store them or give an easier way to at, the very least, re-open plugin folders which are in Packages\

0 Likes

#6

Thanks for the link to the github tracker! I have reposted as https://github.com/SublimeTextIssues/Core/issues/2254

1 Like