@@ -9,7 +9,6 @@ Table of Contents *persisted.nvim-table-of-contents*
9
9
- Usage | persisted.nvim-usage |
10
10
- Configuration | persisted.nvim-configuration |
11
11
- Extending the Plugin | persisted.nvim-extending-the-plugin |
12
- - License | persisted.nvim-license |
13
12
14
13
FEATURES *persisted.nvim-features*
15
14
@@ -28,7 +27,7 @@ REQUIREMENTS *persisted.nvim-requirements*
28
27
29
28
INSTALLATION *persisted.nvim-installation*
30
29
31
- Install the plugin with your preferred package manager:
30
+ Install and configure the plugin with your preferred package manager:
32
31
33
32
**Lazy.nvim**
34
33
@@ -141,32 +140,31 @@ The plugin comes with the following defaults:
141
140
142
141
>lua
143
142
{
144
- ---@type boolean
145
143
autostart = true, -- Automatically start the plugin on load?
146
- ---@type fun(boolean)
147
- should_save = nil, -- Function to determine if a session should be saved
148
- ---@type string
144
+
145
+ -- Function to determine if a session should be saved
146
+ ---@type fun(): boolean
147
+ should_save = function()
148
+ return true
149
+ end,
150
+
149
151
save_dir = vim.fn.expand(vim.fn.stdpath("data") .. "/sessions/"), -- Directory where session files are saved
150
152
151
- ---@type boolean
153
+ follow_cwd = true, -- Change the session file to match any change in the cwd?
152
154
use_git_branch = false, -- Include the git branch in the session file name?
153
-
154
- ---@type boolean
155
155
autoload = false, -- Automatically load the session for the cwd on Neovim startup?
156
- ---@type fun(boolean)
157
- on_autoload_no_session = nil, -- Function to run when `autoload = true` but there is no session to load
158
156
159
- ---@type boolean
160
- follow_cwd = true, -- Change session file name with changes in the cwd?
161
- ---@type table
162
- allowed_dirs = nil, -- Table of dirs that the plugin will start and autoload from
163
- ---@type table
164
- ignored_dirs = nil , -- Table of dirs that are ignored for autosaving and autoloading
157
+ -- Function to run when `autoload = true` but there is no session to load
158
+ ---@type fun(): any
159
+ on_autoload_no_session = function() end,
160
+
161
+ allowed_dirs = {}, -- Table of dirs that the plugin will start and autoload from
162
+ ignored_dirs = {} , -- Table of dirs that are ignored for starting and autoloading
165
163
166
164
telescope = {
167
165
mappings = { -- Mappings for managing sessions in Telescope
168
- change_branch = "<C-b> ",
169
166
copy_session = "<C-c> ",
167
+ change_branch = "<C-b> ",
170
168
delete_session = "<C-d> ",
171
169
},
172
170
icons = { -- icons displayed in the Telescope picker
@@ -411,7 +409,7 @@ Neovim. A custom autocmd can be created which forces the autoload:
411
409
})
412
410
<
413
411
414
- Or, a user who wishes to check whether the current branch is in an a table of
412
+ Or, a user who wishes to check whether the current branch is in a table of
415
413
branches to be ignored:
416
414
417
415
>lua
@@ -427,17 +425,12 @@ branches to be ignored:
427
425
"feature_branch"
428
426
}
429
427
430
- if utils.in_table(persisted.branch(), ignored_branches) ~= nil then
428
+ if not utils.in_table(persisted.branch(), ignored_branches) then
431
429
persisted.load()
432
430
persisted.start()
433
431
end
434
432
<
435
433
436
-
437
- LICENSE *persisted.nvim-license*
438
-
439
- MIT <https://github.com/olimorris/persisted.nvim/blob/main/LICENSE >
440
-
441
434
Generated by panvimdoc <https://github.com/kdheepak/panvimdoc >
442
435
443
436
vim:tw=78:ts=8:noet:ft=help:norl:
0 commit comments