Skip to content

Commit 4ac56d8

Browse files
committed
doc: resession_backend
1 parent 290cb4d commit 4ac56d8

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

README.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# Neovim Session Manager
22

3-
A Neovim plugin that use built-in `:mksession` to manage sessions like folders in VSCode. It allows you to save the current folder as a session to open it later. The plugin can also automatically load the last session on startup, save the current one on exit and switch between session folders.
3+
A Neovim plugin that use built-in `:mksession`/[resession.nvim](https://github.com/stevearc/resession.nvim) to manage sessions like folders in VSCode. It allows you to save the current folder as a session to open it later. The plugin can also automatically load the last session on startup, save the current one on exit and switch between session folders.
44

55
The plugin saves the sessions in the specified folder (see [configuration](#configuration)). The session corresponds to the working directory. If a session already exists for the current folder, it will be overwritten.
66

77
## Dependencies
88

99
- [plenary.nvim](https://github.com/nvim-lua/plenary.nvim) for internal helpers.
10+
- [resession.nvim](https://github.com/nvim-lua/plenary.nvim) (optional) if using `resession` backend.
1011

1112
## Commands
1213

@@ -34,6 +35,7 @@ To configure the plugin, you can call `require('session_manager').setup(values)`
3435
local Path = require('plenary.path')
3536
local config = require('session_manager.config')
3637
require('session_manager').setup({
38+
resession_backend = false, -- Use resession.nvim as backend instead of vim's built-in :mksession
3739
sessions_dir = Path:new(vim.fn.stdpath('data'), 'sessions'), -- The directory where the session files will be saved.
3840
session_filename_to_dir = session_filename_to_dir, -- Function that replaces symbols into separators and colons to transform filename into a session directory.
3941
dir_to_session_filename = dir_to_session_filename, -- Function that replaces separators and colons into special symbols to transform session directory into a filename. Should use `vim.uv.cwd()` if the passed `dir` is `nil`.
@@ -116,6 +118,33 @@ vim.api.nvim_create_autocmd({ 'BufWritePre' }, {
116118
})
117119
```
118120

121+
## Resession backend
122+
123+
If you want to use `resession.nvim` as a backend instead of the built-in `:mksession`, set `resession_backend` to `true` in the configuration. Make sure you have `resession.nvim` installed.
124+
125+
Session-manager Config
126+
```lua
127+
{
128+
"Shatur/neovim-session-manager",
129+
lazy = false,
130+
dependencies = {
131+
{
132+
"stevearc/resession.nvim",
133+
lazy = false,
134+
config = true,
135+
},
136+
},
137+
config = function()
138+
require("session_manager").setup({
139+
-- ...
140+
})
141+
end,
142+
},
143+
```
144+
for session saving config, sen [resession-session-options](https://github.com/stevearc/resession.nvim#setup-options)
145+
146+
## Additional resources
147+
119148
For more information about autocmd and its event, see also:
120149

121150
- [`:help autocmd`](https://neovim.io/doc/user/autocmd.html)

0 commit comments

Comments
 (0)