From fb3e9a47983c49892183f67d2dc2c7e5355485c5 Mon Sep 17 00:00:00 2001 From: Ivan Golikov Date: Sat, 12 Sep 2026 00:56:04 +0200 Subject: [PATCH] feature: nvim: Autoload of last session if started without arguments --- nvim/config.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nvim/config.lua b/nvim/config.lua index 93efdac..0d779e7 100644 --- a/nvim/config.lua +++ b/nvim/config.lua @@ -36,3 +36,12 @@ require'nvim-treesitter.configs'.setup { }, } vim.opt.runtimepath:append(vim.fn.stdpath "data" .. "site") + +-- Load last session when started without arguments +vim.api.nvim_create_autocmd("VimEnter", { + callback = function() + if vim.fn.argc() == 0 then + require("persistence").load() + end + end, +})