🐛 fix(nvim): persisted autocmd is now afected at init
This commit is contained in:
parent
12798112ba
commit
2d27e7e8e8
1 changed files with 12 additions and 11 deletions
|
@ -1,14 +1,3 @@
|
||||||
vim.api.nvim_create_autocmd({ "User" }, {
|
|
||||||
pattern = "PersistedTelescopeLoadPre",
|
|
||||||
callback = function(session)
|
|
||||||
-- Save the currently loaded session using a global variable
|
|
||||||
require("persisted").save({ session = vim.g.persisted_loaded_session })
|
|
||||||
|
|
||||||
-- Delete all of the open buffers
|
|
||||||
vim.api.nvim_input("<ESC>:%bd!<CR>")
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"folke/persistence.nvim",
|
"folke/persistence.nvim",
|
||||||
|
@ -16,6 +5,18 @@ return {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"olimorris/persisted.nvim",
|
"olimorris/persisted.nvim",
|
||||||
|
init = function()
|
||||||
|
vim.api.nvim_create_autocmd({ "User" }, {
|
||||||
|
pattern = "PersistedTelescopeLoadPre",
|
||||||
|
callback = function(session)
|
||||||
|
-- Save the currently loaded session using a global variable
|
||||||
|
require("persisted").save({ session = vim.g.persisted_loaded_session })
|
||||||
|
|
||||||
|
-- Delete all of the open buffers
|
||||||
|
vim.api.nvim_input("<ESC>:%bd!<CR>")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
lazy = false,
|
lazy = false,
|
||||||
config = function()
|
config = function()
|
||||||
LazyVim.on_load("telescope.nvim", function()
|
LazyVim.on_load("telescope.nvim", function()
|
||||||
|
|
Loading…
Add table
Reference in a new issue