diff --git a/.config/nvim/lua/core/autocommands.lua b/.config/nvim/lua/core/autocommands.lua index f29a28c..885917d 100644 --- a/.config/nvim/lua/core/autocommands.lua +++ b/.config/nvim/lua/core/autocommands.lua @@ -24,7 +24,7 @@ vim.api.nvim_create_autocmd({ "FileType" }, { end, }) --- Disable illuminate on very large files +-- Disable illuminate on very large files vim.api.nvim_create_autocmd({ "BufWinEnter" }, { callback = function() local line_count = vim.api.nvim_buf_line_count(0) @@ -33,3 +33,11 @@ vim.api.nvim_create_autocmd({ "BufWinEnter" }, { 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, +})