summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/plugins/auto-session.lua
blob: b37629d748c27e774a8a3fbccad249a20de970c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
return {
    'rmagatti/auto-session',
    lazy = false,
    opts = {
        suppressed_dirs = { '~/', '/' },
        session_lens = { load_on_setup = false },
        bypass_save_filetypes = { 'snacks_dashboard', 'terminal' },
        close_filetypes_on_save = { 'checkhealth', 'build_terminal' },
        pre_save_cmds = {
            function()
                for _, buf in ipairs(vim.api.nvim_list_bufs()) do
                    if vim.bo[buf].buftype == 'terminal' then
                        vim.api.nvim_buf_delete(buf, { force = true })
                    end
                    if vim.bo[buf].filetype == 'build_terminal' then
                        vim.api.nvim_buf_delete(buf, { force = true })
                    end
                end
            end,
        },
    },
}