-
-
Notifications
You must be signed in to change notification settings - Fork 55
Open
Description
Is your feature request related to a problem? Please describe.
I deep use auto-session for a long time, this is an convenient plugin in moust time, a little touble is about command hook usage, we have write all hook function in setup() config
require('auto-session').setup {
{hook_name}_cmds = {"{hook_command1}", "{hook_command2}"}
save_extra_cmds = {
function()
return [[echo "hello world"]]
end
}
}
EOFwhich couple other plugin with auto-session.setup(), which may be affected by the order of plugin setup()
Describe the solution you'd like
Can we provide a register hook mechanism, e.g.
require("auto-session").register_pre_save_hook("my_hook_identifier", function()
-- do something
end)Other plugin/config can register hook anywhere, with it identifier, plugin/config can update the hook function if they what
Of couse, the name of api just example, we should have a contract in api design, which is controllerd by auto-session's maintainer
Additional context
Some extend ability via register function examples:
- https://github.com/stevearc/overseer.nvim/blob/master/doc/guides.md#custom-tasks
- https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/MAIN.md#registration
I will be pleasure to implement the feature with API contract
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request