From a9a691cad229ca27b02d64c9b8ff4ef728ab37aa Mon Sep 17 00:00:00 2001 From: Charles Danesi Date: Sat, 7 Dec 2024 18:48:56 -0500 Subject: [PATCH] fix: nvim-tree no longer stops working when restoring a session add nvim-tree as a dependency of auto-session prevents nvim-tree commands not working when restoring a session with sessionopts+='globals' --- .config/nvim/lua/core/options.lua | 4 ++-- .config/nvim/lua/plugins/auto-session.lua | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.config/nvim/lua/core/options.lua b/.config/nvim/lua/core/options.lua index b66e4cb..c9d3cc4 100644 --- a/.config/nvim/lua/core/options.lua +++ b/.config/nvim/lua/core/options.lua @@ -86,7 +86,7 @@ o.undodir = { vim.fn.stdpath('state') .. '/undo/' .. '/' } -- │ NvimTree from working -- │ after session is restored. -- └ -o.sessionoptions = 'buffers,curdir,folds,localoptions,help,tabpages,terminal,winsize,winpos' +o.sessionoptions = 'globals,buffers,curdir,folds,localoptions,help,tabpages,terminal,winsize,winpos' -- ────────────────────────────────────────────────── split windows ── o.splitright = true o.splitbelow = true @@ -95,4 +95,4 @@ o.ignorecase = true o.smartcase = true o.iskeyword:append('-') -- consider string-string as a whole word -- ───────────────────────────────────────────────────── completion ── -o.completeopt = 'menu,preview,noselect' \ No newline at end of file +o.completeopt = 'menu,preview,noselect' diff --git a/.config/nvim/lua/plugins/auto-session.lua b/.config/nvim/lua/plugins/auto-session.lua index 74a312c..70815f4 100644 --- a/.config/nvim/lua/plugins/auto-session.lua +++ b/.config/nvim/lua/plugins/auto-session.lua @@ -1,5 +1,11 @@ return { 'rmagatti/auto-session', + -- ┌ + -- │ add nvim-tree as a dependency to stop sessions to + -- │ reload with nvim-tree commands unavailable when saving + -- │ with sessionopts+='globals' + -- └ + dependencies = { 'nvim-tree/nvim-tree.lua' }, lazy = false, ---@module "auto-session" @@ -26,4 +32,4 @@ return { pre_save_cmds = {}, post_restore_cmds = {}, }, -} \ No newline at end of file +}