WARNING : This plugin doesn't have cool features !
Zessions is just a plugin for Neovim that let the user manage its session files without having to type full paths, that's all !
Zessions is developed for Neovim Nightly (>=0.5).
Even if Zessions is a plugin on its own, the experience is a lot better with the awesome Telescope plugin, so a Telescope extension is included !
Plug 'Ind1eMonk3y/zessions'
use 'Ind1eMonk3y/zessions'
paq "Ind1eMonk3y/zessions"
Default configuration :
require("zessions").config:update({
cwd = vim.fn.stdpath("data").."/sessions",
force_overwrite = false,
force_delete = false,
bdelete = false,
verbose = true,
})
cwd
: Directory where the sessions files are stored. This directory must exists, it won't be created !force_overwrite
: If set totrue
, an existing session file will be overwritten without asking for confirmation.force_delete
: If set totrue
, an existing session file will be deleted without asking for confirmation.bdelete
: If set totrue
, existing buffers that are not modified will be deleted before restoring a session.verbose
: If set tofalse
, messages about saved, deleted or restored sessions won't be printed under the statusline.
The extension configuration can be set via Telescope setup function.
Under the hood, the extension use telescope.find_files
.
require('telescope').setup{
extensions = {
zessions = {
cwd = vim.fn.stdpath("data").."/sessions",
layout_config = {
width = 55,
},
},
}
}
require('telescope').load_extension('zessions')
The extension configuration can also be set via the extension main function.
require('telescope').extensions.zessions.sessions({
cwd = vim.fn.stdpath("data").."/sessions/vim_nvim",
layout_config = {
width = 55,
},
})
For convenience, the plugin configuration can also be set by passing a second table.
require('telescope').extensions.zessions.sessions({
cwd = vim.fn.stdpath("data").."/sessions/vim_nvim",
layout_config = {
width = 55,
},
},
{
cwd = vim.fn.stdpath("data").."/sessions",
force_overwrite = false,
force_delete = false,
bdelete = false,
verbose = true,
})
The plugin doen't use or provide any mappings.
The extension has default mappings to help manage the sessions files.
All mappings are set for the insert mode in the dropdown prompt.
<C-a>
: Add or overwrite the session file by using the prompt input as file name.<C-s>
: Save or overwrite the session file by using the selected entry as file name.<C-d>
: Delete the session file by using the selected entry as file name.<C-e>
: Complete prompt input by using the selected entry as file name.<CR>
: Restore the session by using the selected entry.
This project is in early stage but definitely usable !