From 4eedc91d75d9d3e32a7a5759073c73652d4d08b5 Mon Sep 17 00:00:00 2001 From: Nanozuki Crows Date: Sat, 31 Aug 2024 12:51:54 +0800 Subject: [PATCH] fix(neovim): after update of auto-session --- configs/nvim/lua/plugins/basic.lua | 4 +++- configs/nvim/lua/plugins/search.lua | 3 --- configs/nvim/lua/plugins/startup.lua | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/configs/nvim/lua/plugins/basic.lua b/configs/nvim/lua/plugins/basic.lua index 2d5afab..5af61cd 100644 --- a/configs/nvim/lua/plugins/basic.lua +++ b/configs/nvim/lua/plugins/basic.lua @@ -21,16 +21,18 @@ return { end end end - ---@diagnostic disable-next-line: missing-fields require('auto-session').setup({ auto_session_suppress_dirs = { '~' }, pre_save_cmds = { clean_buffers }, + cwd_change_handling = true, + pre_cwd_changed_cmds = { clean_buffers }, session_lens = { load_on_setup = false, }, }) vim.keymap.set('n', 'sr', 'SessionRestore', { desc = 'Restore session' }) vim.keymap.set('n', 'ss', 'SessionSave', { desc = 'Save session' }) + vim.keymap.set('n', 'fs', 'SessionSearch', { desc = 'Find session' }) end, }, { 'dstein64/vim-startuptime', cmd = 'StartupTime' }, diff --git a/configs/nvim/lua/plugins/search.lua b/configs/nvim/lua/plugins/search.lua index 1a1228e..3ebefb1 100644 --- a/configs/nvim/lua/plugins/search.lua +++ b/configs/nvim/lua/plugins/search.lua @@ -5,7 +5,6 @@ return { dependencies = { { 'nvim-lua/plenary.nvim' }, { 'nvim-telescope/telescope-z.nvim' }, - 'rmagatti/auto-session', }, config = function() require('telescope').load_extension('z') @@ -37,8 +36,6 @@ return { ) vim.keymap.set('n', 'ft', require('telescope.builtin').treesitter, { desc = 'List item by treesitter' }) vim.keymap.set('n', 'z', require('telescope').extensions.z.list, { desc = 'Find path by z' }) - require('auto-session').setup_session_lens() - vim.keymap.set('n', 'fs', require('auto-session.session-lens').search_session, { desc = 'Find session' }) end, }, } diff --git a/configs/nvim/lua/plugins/startup.lua b/configs/nvim/lua/plugins/startup.lua index d85850d..04074d1 100644 --- a/configs/nvim/lua/plugins/startup.lua +++ b/configs/nvim/lua/plugins/startup.lua @@ -50,7 +50,7 @@ local function config() require('telescope').extensions.z.list() end), button('s', '󰉓 Open Session', function() - require('auto-session.session-lens').search_session() + vim.cmd('SessionSearch') end), button('u', '󰚰 Plugin update', function() require('lazy').sync()