Closed BrunoKrugel closed 1 year ago
It can be done: could you specify how you would like the function to work? If I understand correctly, it should simply check if you are in a loaded session and if so, delete it from disk?
Exactly, so we can have, for example:
{
"gennaro-tedesco/nvim-possession",
dependencies = {
"ibhagwan/fzf-lua",
},
config = true,
init = function()
local possession = require("nvim-possession")
vim.keymap.set("n", "<leader>sl", function()
possession.list()
end)
vim.keymap.set("n", "<leader>sn", function()
possession.new()
end)
vim.keymap.set("n", "<leader>su", function()
possession.update()
end)
vim.keymap.set("n", "<leader>sd", function()
possession.delete()
end)
end,
}
I have created a draft PR to address this issue.
Could you please help me test if this is what you wished? You can install the branch delete_local_session
(via your package manager of choice) and <leader>sd
is the suggested mapping to be set (as you mention above).
it works!
I will have another go at the code to see if I can polish it a little and test it again: will merge in the next days (I may be busy at work so bear with me, but I don't forget :p)
This change has been included in the latest release v0.0.9. Just update your plugin via your package manager of choice and you're good to go :)
Would be a nice feature to expose the
delete()
function, so we can delete the current session (like the update or save), without having to open the list and then delete manually the session.