Sublime Forum

Package Plugins

#1

I am creating a new plugin, and the plugin python scripts are not loading on start up. ( Sublime Text 3083)
If I paste the same python file in the User directory, then it is automatically reloaded.

The package is being loaded because the tmLangauge and tmTheme files are being read and get created as options in the menu.

0 Likes

#2

Where did you save your plugin (.py) file? Plugins are only loaded if they are in at most one sub-directory under the “Packages” directory.

0 Likes

#3

The sublime-package file does not have any directories; all files are at the top level.

myPackage.sublime-package
mylanguage.tmLanguage
myTheme.tmTheme
hello_world.py

0 Likes

#4

I’m not sure I understand. Are these files part of your .sublime-package file? If so, where did you place it exactly?

0 Likes

#5

Yes they are zipped in the sublime-package file.
The mypackage.sublime-package is in %AppData%/Sublime Text 3/Installed Packages

My machines are Windows 7 Ultimate - 64 bit and Windows 8.1 Enterprise - 64 bit, if this is relevant.

Thanks!

0 Likes

#6

Seems all good so far.

You say that the syntax def and color scheme are recognized, but not the plugin file. What makes you say so? Is there a “reloading plugin mypackage.hello_world” text in the console when you start ST?

0 Likes

#7

In the mypackage.sublime-package file, it does not load the python script; I do not see the reloading message.

I do see the message if I take the helloworld.py file and copy it into the %AppData%…Packages/User directory.

0 Likes

#8

Is there some other file I need to put in the sublime-packages file, such as “Default.sublime-commands” to bine the plugin commands?

0 Likes

#9

No, you don’t need that in order to have the plugin loaded – that should happen any way.

I’m honestly out of ideas now. The only remaining thing I can do is test if it works for me. Could you upload your .sublime-package file somewhere?

0 Likes

#10

Sometimes you just have to walk away, and take a deep breath.

My package actually contained a top level directory

myPackage.sublime-package
myPackage
mylanguage.tmLanguage
myTheme.tmTheme
hello_world.py

I flattened out the package and the plugins load successfully.

Thanks!

0 Likes