Better plugin development experience
Is your feature request related to a problem? Please describe.
It is not easy to test your changes on a local plugin.
If I change the code for a local plugin the changes don't get reflected, even if using the update_all function, you need to commit your changes for them to take effect.
Describe the solution you'd like A way to load an in-development plugin that gets updated in an easier way, hopefully automatically.
Describe alternatives you've considered I have been copying and pasting parts of my code between my config file and my plugin file to test it before I commit and validate it works as expected.
Hello,
Can you show how you're currently using your local plugin in your config?
I'm not super familiar with wezterm plugins as I don't use that feature, but IIRC you can use a file:///path/to/plugin as the url to load a local plugins easily
@bew Yes I am loading it like this:
local stack = wezterm.plugin.require("file:///Users/rafa/dev/stack_wez")
The problem is it does not read directly from that folder. It copies the files to the same place it clones other plugins and my changes are not reflected unless I commit it, then it will copy the new version.
@bad-noodles I agree with your view. I found it unproductive/troublesome developing a plugin using wezterm.plugin.require("file:///Users/rafa/dev/stack_wez") as it requires too many steps to implement a single change. Its great for loading and using a remote plugin that is already developed. It isn't great for developing a plugin from scratch.
To circumvent the unproductive workflow, presently I:
- First develop a plugin as a standard Lua module in one of the sub-directory of
wezterm.config_dirand use Lua'srequireto load it in . - After doing all the troubleshooting of the module, I then:
- copy its entire directory to
/Users/rafa/dev/stack_wez/<name of plugin>/plugin.pluginis its new directory name. - rename my module file to
init.lua - make changes to
init.luato accommodate all the requirements mentioned in https://github.com/wezterm/wezterm/blob/main/docs/config/plugins.md. To further circumvent unproductivity, I have even gone into~/.local/share/wezterm/plugins/<name of plugin>/plugin/init.luato make the changes there. Once everything works, I would then copy the changes into/Users/rafa/dev/stack_wez/<name of plugin>/plugin/init.lua.
- copy its entire directory to
I don't know how others create their plugins in a productive manner but the above is what I have figured out while developing my plugins. Do note that I am a relatively new user of WezTerm and not its expert.
Like you I too would like to see a way to load an in-development plugin that gets updated in an easier way, hopefully automatically.