Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/math2001/sublime-plugin-reloader
Reload files in your Sublime Text's plugins
https://github.com/math2001/sublime-plugin-reloader
plugin-reloader sublime-text
Last synced: 29 days ago
JSON representation
Reload files in your Sublime Text's plugins
- Host: GitHub
- URL: https://github.com/math2001/sublime-plugin-reloader
- Owner: math2001
- Created: 2016-12-28T02:25:58.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-09-06T07:40:28.000Z (over 4 years ago)
- Last Synced: 2024-11-10T07:41:25.664Z (3 months ago)
- Topics: plugin-reloader, sublime-text
- Language: Python
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Reload Plugin
Reload Plugin is a ... plugin that reloads your Sublime Text's plugins. As you probably know, Sublime Text doesn't load the `.py` files that are more than 2 folders deep (your package folder, if it's deeper, it's ignored).
## Usage
Just add a listener in your package:
```python
import sublime
import sublime_plugin
import osclass MyPluginDevListner(sublime_plugin.EventListner):
def on_post_save(self, view):
if not (os.path.dirname(__file__) in view.file_name() and
view.file_name().endswith('.py')):
return
sublime.run_command('reload_plugin', {
'main': os.path.join(sublime.packages_path(), 'MyPlugin',
'MyPlugin.py')
'scripts': ['functions.py'] # at the root of your plugin,
'folders': ['my_plugin_commands'] # all the files will be relaoded
'times': 2 # default value: 2,
'quiet': True # prevent default output in the console
})```
By default, it reloads everything twice to make sure that your dependencies are reloaded. If you have imported-importing-from-imported script or something a bit nested, you might want to increase it.
Note: The `.py` in the script name is optional.
A little tip: if you put this command in your main file, you can use the `__file__` variable (`'main': __file__`')
## Install
##### Using git
```bash
cd "%APPDATA%\Sublime Text 3\Packages" # on window
cd ~/Library/Application\ Support/Sublime\ Text\ 3 # on mac
cd ~/.config/sublime-text-3 # on linuxgit clone https://github.com/math2001/sublime-plugin-reloader reload_plugin
```##### Using Package Control
Because it is not available on package control for now, you have to add this repo "manually" to your list.
1. Open up the command palette (`ctrl+shift+p`), and find `Package Control: Add Repository`. Then enter the URL of this repo: `https://github.com/math2001/reload_plugin` in the input field.
2. Open up the command palette again and find `Package Control: Install Package`, and just search for `reload_plugin`. (just a normal install)