A simple session management plugin for Neovim. It uses
:mksession
to save and :source
to load working
directory based sessions.
[!WARNING] This plugin is based on my personal needs. Work in progress. 🚀
Other better plugins are:
vim.fn.stdpath('data')
inblank
from the :h sessionoptions
)[!TIP] See
:h sessionoptions
to change what is stored in the session file with:mksession
.
return {
'tigion/nvim-sessions',
keys = {
{ '<Leader>ws', '<Cmd>Session save<CR>', desc = 'Save session (cwd)' },
{ '<Leader>wl', '<Cmd>Session load<CR>', desc = 'Load session (cwd)' },
},
opts = {},
}
The default options are:
{
-- The name of the subdirectory in `vim.fn.stdpath('data')`
-- where the sessions are saved.
-- If it does not exist, it will be created.
directory = 'sessions', ---@type string
-- Overwrites existing session files without confirmation.
overwrite = true, ---@type boolean
}
For other plugin manager, call the setup function
require('sessions').setup({ ... })
directly.
Command | Description |
---|---|
:Session |
Shows information about the current session and the Session command |
:Session save |
Saves the current session for the current working directory |
:Session load |
Loads the session for the current working directory |
:Session delete |
Deletes the session for the current working directory |
Run :checkhealth sessions
to check the health of the plugin.