mackeper / SeshMgr.nvim

Session management plugin for Neovim
MIT License
8 stars 0 forks source link
lua neovim neovim-plugin nvim nvim-lua nvim-plugin plugin

SeshMgr.nvim

SeshMgr.nvim is a session management plugin for Neovim to save and load sessions. ![Logo](./.github/images/image.png) [![Docs](https://github.com/mackeper/SeshMgr.nvim/actions/workflows/docs.yml/badge.svg)](https://github.com/mackeper/SeshMgr.nvim/actions/workflows/docs.yml) [![Tests](https://github.com/mackeper/SeshMgr.nvim/actions/workflows/tests.yml/badge.svg)](https://github.com/mackeper/SeshMgr.nvim/actions/workflows/tests.yml) [Introduction](#introduction-wave) • [Features](#features-sparkles) • [Installation](#installation-package) • [Configuration](#configuration-gear) • [Contributing](#contributing-tada) • [Related Projects](#related-projects-link)

Introduction :wave:

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.

Features :sparkles:

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.

Commands :keyboard:

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.

Telescope :telescope:

You can delete and load sessions using telescope.

Installation :package:

With folke/lazy.nvim ```lua { "mackeper/SeshMgr.nvim", event = "VeryLazy", opts = {}, -- optional keymappings keys = { { "sl", "SessionLoadLast", desc = "Load last session" }, { "sc", "SessionLoadCurrent", desc = "Load current session" }, { "sL", "SessionList", desc = "List sessions" }, { "ss", "SessionSave", desc = "Save session" }, }, } ``` You need to either have the `opts` table or call the `setup({})` function in your config.

Configuration :gear:

To configure the plugin, pass a table to the setup function or in the case of lazy the opts table.

Example ```lua require("seshmgr").setup({ session_dir = vim.fn.stdpath("data") .. "/my_sessions", autosave = false, telescope = { enabled = false, }, }) ```

Default configuration

{
    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",
    },
}

Contributing :tada:

See CONTRIBUTING.md

Related Projects :link: