Add explorer integration after snacks has already setup #2152
-
I've added two actions to the explorer which call commands exposed by a different plugin. So far this is working great! However, I would rather create these definitions later when the dependent plugin has loaded. Currently this is what I'm doing, which works perfectly: {
"folke/snacks.nvim",
opts = {
explorer = {
enabled = true,
replace_netrw = true
},
picker = {
enabled = true,
actions = {
transfer_up = function(picker, item)
vim.cmd.TransferUpload(item.file)
end,
transfer_down = function(picker, item)
vim.cmd.TransferDownload(item.file)
end,
},
sources = {
explorer = {
win = {
list = {
keys = {
['tu'] = 'transfer_up',
['td'] = 'transfer_down',
}
}
}
}
}
},
... snip ... While this is working, I would rather do something like this: return {
'transfer.nvim',
config = function()
require 'transfer'.setup {}
require 'snacks'.setup {
... config here ...
}
end
} However, when I tried this I received an error notification that snacks was already setup, which makes sense. Any suggestions or perhaps should I just live with having the definitions live in the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
https://github.com/folke/snacks.nvim/blob/main/docs/picker.md#-examples |
Beta Was this translation helpful? Give feedback.
https://github.com/folke/snacks.nvim/blob/main/docs/picker.md#-examples