https://github.com/ingram1107/souvenir.nvim
A Neovim plugin that manages Neovim sessions
https://github.com/ingram1107/souvenir.nvim
lua neovim nvim nvim-plugin session-management
Last synced: about 1 year ago
JSON representation
A Neovim plugin that manages Neovim sessions
- Host: GitHub
- URL: https://github.com/ingram1107/souvenir.nvim
- Owner: ingram1107
- License: gpl-3.0
- Created: 2021-07-06T10:20:43.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-09-18T03:04:37.000Z (over 2 years ago)
- Last Synced: 2025-01-31T10:42:33.078Z (about 1 year ago)
- Topics: lua, neovim, nvim, nvim-plugin, session-management
- Language: Lua
- Homepage:
- Size: 49.8 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# souvenir.nvim
A Neovim plugin that manages Neovim sessions
## Requirement
Neovim 0.7+
## Installation
vim-plug
```viml
Plug 'ingram1107/souvenir.nvim'
```
packer
```lua
use {
'ingram1107/souvenir.nvim',
}
```
## Usage
You could set-up your session path as follows:
```lua
require('souvenir').setup {
session_path = '~/.config/nvim/sessions'
}
```
Or else the default session path would be set to a directory named `souvenirs`
in your system's standard data path. (`$XDG_DATA_HOME/nvim` if you are using
Linux, `~/AppData/Local/nvim-data` if you are using Windows)
Other settings such as `override` and `shada` are available too. Set `override`
to `true` will allow the behaviour of overriding an existing session to be the
default behaviour. Set `shada` to `true` will allow more information in the
current session to be stored such as command line history, contents of registers
and marks for files. (more details see `:h shada`) Defaults values are set as
below:
```lua
require('souvenir').setup {
override = false,
shada = true,
}
```
souvenir.nvim currently provides 6 functionalities: save Vim session, restore
Vim session, delete Vim session, continuous session recording, stop such
recording, and list Vim sessions. Commands to call these 6 functionalities are
shown as below:
```viml
:SouvenirSave[!] " save session (`!` to override)
:SouvenirRestore
:SouvenirDelete " accept multiple files
:SouvenirRecord " record current session
:SouvenirStopRecord
:SouvenirList
```
```lua
:lua require('souvenir').save_session{'souvenir'} -- don't override existing session file
:lua require('souvenir').save_session{'souvenir', true} -- override exisitng session file
:lua require('souvenir').restore_session('souvenir')
:lua require('souvenir').delete_session({ 'souvenir', 'memoir', 'nostalgic' })
:lua require('souvenir'),record_session('souvenir') -- automatic override
:lua require('souvenir').stop_record_session()
:lua require('souvenir').list_session()
```
If option `override` is set to true, there should be no behavioural differences
between `:SouvenirSave` and `:SouvenirSave!` or their lua counterparts. **Note**
that `SouvenirRecord` will override regardless of the `override` option value.
## Inspiration
[xolox/vim-session](https://github.com/xolox/vim-session)
[tpope/vim-obsession](https://github.com/tpope/vim-obsession)
## Todo
- [x] documentation
- [x] save session to a pre-configured location
- [x] restore session
- [x] delete session
- [x] delete multiple sessions
- [x] list sessions
- [x] session name completion
- [x] interactive buffer (telescope)
- [x] cross-platform
- [x] Windows
- [x] Linux
- [ ] macOS (waiting for someone to test)
- [ ] BSD-variants (waiting for someone to test)