1
0
mirror of https://github.com/dcarrillo/dotfiles.git synced 2024-12-22 12:48:01 +00:00

[neovim] Autostore session on VimExit event

This commit is contained in:
Daniel Carrillo 2023-02-05 17:04:33 +01:00
parent 21e220944f
commit b6dd8032be
Signed by: dcarrillo
GPG Key ID: E4CD5C09DAED6E16

View File

@ -24,7 +24,7 @@ vim.api.nvim_create_autocmd({ "FileType" }, {
end, end,
}) })
-- Disable illuminate on very large files -- Disable illuminate on very large files
vim.api.nvim_create_autocmd({ "BufWinEnter" }, { vim.api.nvim_create_autocmd({ "BufWinEnter" }, {
callback = function() callback = function()
local line_count = vim.api.nvim_buf_line_count(0) local line_count = vim.api.nvim_buf_line_count(0)
@ -33,3 +33,11 @@ vim.api.nvim_create_autocmd({ "BufWinEnter" }, {
end end
end, end,
}) })
-- Autostore session on VimExit
local Session = require("projections.session")
vim.api.nvim_create_autocmd({ "VimLeavePre" }, {
callback = function()
Session.store(vim.loop.cwd())
end,
})