A lightweight Neovim plugin to manage session based on current working directory.
- Save sessions and load sessions
- list sessions
Using lazy.nvim
{
'njayman/season.nvim',
opts = {
show_notifications = true, -- Enable or disable notifications (default: true)
}
}
Plug 'njayman/season.nvim'
After installing the plugin, you need to set it up. Add the following configuration in your init.lua (or init.vim):
require('season').setup({
show_notifications = true, -- Enable or disable session messages (default: true)
})
- show_notifications (boolean): Set to true to enable notifications when saving/loading sessions. Set to false to disable them. The default value is true.
To save your current session, call the following function in Neovim:
:lua require('season').save_session()
To load a previously saved session, use:
:lua require('season').load_session()
You can create your own keybindings in your init.lua or init.vim file. For example:
vim.keymap.set('n','<leader>ss', function() require('season').save_session() end, { desc = "Save Session" })
vim.keymap.set('n', '<leader>sl', function() require('season').load_session() end, { desc = "Load Session" })
Feel free to customize the key bindings as per your preference.
Session files are stored in the following directory:
~/.local/share/nvim/season_sessions/
Each session file is named using the hash of the current working directory, making it unique.
If a session does not load or save correctly, ensure that you have write permissions to the session directory. Verify that Neovim has access to the correct directories by checking the output of :echo stdpath('data').
Contributions are welcome! If you find a bug or want to add a feature, feel free to open an issue or submit a pull request.
This plugin is licensed under the MIT License. See the LICENSE file for more details.
Thanks to all the contributors of Neovim and its plugins.