How can I reload vimperator plugin after I modify it? Now I restart browser each time I need reload but it is nightmare to develop plugins like this.
Vimperator doesn't seem to have a reload command for plugins. The closest command would be
:loadplugins
which will load any unloaded plugins. If you can find a way to unload a plugin, possibly with Javascript, you should be able to use this to reload it.
UPDATE: You can use the following command
:command! reloadPlugins :js liberator.pluginFiles = {}; liberator.loadPlugins();
This will reload all plugins.
Note that this command as written just "deregisters" plugins, which allows them to be reloaded. It doesn't remove any commands or bindings defined by the previous version of the plugin, just overwrites them.
If you want to actually remove the previous commands and bindings (eg. if some commands have been removed from the plugin), you could write a "clean up" command for a specific plugin using :delcommand
, :unmap
, etc. to delete each command/mapping/etc defined in the plugin.
You could also modify the :reloadPlugins
command above, to use :comclear
, which removes all user-defined bindings. In that case, you'd need to :source ~/.vimperatorrc
as well as reload the plugins.
On Pentadactyl, there are a couple of relevant commands:
:delgroup <Plugin Group Name>
:loadplugins
which will delete the plugin's command group and then load any unloaded plugins (including the just-deleted one). This is the fastest option. You could combine the commands into a key binding, eg.:
:map -g user -b <C-c><C-p> :delgroup <Plugin Group Name> | loadplugins<CR>
The most sure-fire solution is:
:rehash
This will restart Pentadactyl (without restarting FF). This may take a few seconds, depending on your system.