How to use PersistenceSavePre to run commands before saving sessions? #78
-
|
The readme just lists the events to be called, but I just spent a bunch of time trying to figure out and couldn't. I looked at this issue showing this snippet, which the user reports doesn't work. vim.api.nvim_create_autocmd("PersistenceSavePre", {
desc = "Fix neo-tree before saving",
-- group = "persistence",
callback = function()
print("savePre")
end,
})Folke replied with |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
The event is User and the pattern is the persistentcepre thing |
Beta Was this translation helpful? Give feedback.
-
|
Here's an example: local group = vim.api.nvim_create_augroup('user-persistence', { clear = true })
vim.api.nvim_create_autocmd('User', {
group = group,
pattern = 'PersistenceSavePre',
callback = function()
print("savePre")
end,
}) |
Beta Was this translation helpful? Give feedback.
The event is User and the pattern is the persistentcepre thing