I made this plugin for myself, there are many other plugins that do the same thing, see related projects. The main difference is that this plugin is that the telescope integration lists session with timestamps and in order of last used.
Manually save and load sessions using commands or use telescope to manage sessions. By default, autosave is enabled to save the session when exiting Neovim. This can be disabled in the configuration.
Command | Description |
---|---|
:SessionSave |
Save the current session by current working directory (cwd). |
:SessionLoad {session_full_path} |
Load the given session path. |
:SessionLoadLast |
Load the last session. |
:SessionLoadCurrent |
Load session for current working directory if exists. |
:SessionDelete {session_full_path} |
Delete the given session. |
:SessionDeleteCurrent |
Delete the file associated with the current session. |
:SessionList |
List all session files. |
You can delete and load sessions using telescope.
<leader>js
to open telescope (configurable)
<CR>
to load session.<C-d>
to delete session.To configure the plugin, pass a table to the setup function or in the case of lazy the opts table.
{
session_dir = vim.fn.stdpath("data") .. "/sessions",
session_name_delimiter = "!!",
session_windows_drive_delimiter = ";;",
autosave_events = { "ExitPre" },
autosave = true,
telescope = {
enabled = true,
keymap = "<leader>js",
},
}
See CONTRIBUTING.md