1
0
Fork 1
Dotfiles_nvim/lua/editor/sessions.lua

40 lines
1.3 KiB
Lua

local K = require('core.keymap')
return {
'shatur/neovim-session-manager',
dependencies = {
'nvim-lua/plenary.nvim',
},
config = function()
local Path = require('plenary.path')
local config = require('session_manager.config')
local session_manager = require('session_manager')
session_manager.setup({
sessions_dir = Path:new(vim.fn.stdpath('data'), 'sessions'),
autoload_mode = config.AutoloadMode.Disabled,
autosave_last_session = true,
autosave_ignore_not_normal = true,
autosave_ignore_dirs = {},
autosave_ignore_filetypes = {
'gitcommit',
'gitrebase',
},
autosave_ignore_buftypes = {},
autosave_only_in_session = true,
max_path_length = 80,
})
vim.keymap.set(
K.SESSIONS.MENU.mode,
K.SESSIONS.MENU.shortcut,
session_manager.available_commands,
{ desc = K.SESSIONS.MENU.description }
)
vim.keymap.set(
K.SESSIONS.CREATE.mode,
K.SESSIONS.CREATE.shortcut,
session_manager.save_current_session,
{ desc = K.SESSIONS.CREATE.description }
)
end,
}