🐛 fix(nvim): persisted autocmd is now afected at init

This commit is contained in:
Sergio Laín 2024-08-10 16:17:19 +02:00
parent 12798112ba
commit 2d27e7e8e8
No known key found for this signature in database
GPG key ID: 8429B2EE312F8150

View file

@ -1,4 +1,12 @@
vim.api.nvim_create_autocmd({ "User" }, { return {
{
"folke/persistence.nvim",
enabled = false,
},
{
"olimorris/persisted.nvim",
init = function()
vim.api.nvim_create_autocmd({ "User" }, {
pattern = "PersistedTelescopeLoadPre", pattern = "PersistedTelescopeLoadPre",
callback = function(session) callback = function(session)
-- Save the currently loaded session using a global variable -- Save the currently loaded session using a global variable
@ -7,15 +15,8 @@ vim.api.nvim_create_autocmd({ "User" }, {
-- Delete all of the open buffers -- Delete all of the open buffers
vim.api.nvim_input("<ESC>:%bd!<CR>") vim.api.nvim_input("<ESC>:%bd!<CR>")
end, end,
}) })
end,
return {
{
"folke/persistence.nvim",
enabled = false,
},
{
"olimorris/persisted.nvim",
lazy = false, lazy = false,
config = function() config = function()
LazyVim.on_load("telescope.nvim", function() LazyVim.on_load("telescope.nvim", function()