Skip to content

Commit 7e170b4

Browse files
committed
docs: update README.md
1 parent 22e17b0 commit 7e170b4

File tree

2 files changed

+19
-30
lines changed

2 files changed

+19
-30
lines changed

README.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -403,12 +403,8 @@ local ignored_branches = {
403403
"feature_branch"
404404
}
405405

406-
if utils.in_table(persisted.branch(), ignored_branches) ~= nil then
406+
if not utils.in_table(persisted.branch(), ignored_branches) then
407407
persisted.load()
408408
persisted.start()
409409
end
410410
```
411-
412-
## :page_with_curl: License
413-
414-
[MIT](https://github.com/olimorris/persisted.nvim/blob/main/LICENSE)

doc/persisted.nvim.txt

+18-25
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ Table of Contents *persisted.nvim-table-of-contents*
99
- Usage |persisted.nvim-usage|
1010
- Configuration |persisted.nvim-configuration|
1111
- Extending the Plugin |persisted.nvim-extending-the-plugin|
12-
- License |persisted.nvim-license|
1312

1413
FEATURES *persisted.nvim-features*
1514

@@ -28,7 +27,7 @@ REQUIREMENTS *persisted.nvim-requirements*
2827

2928
INSTALLATION *persisted.nvim-installation*
3029

31-
Install the plugin with your preferred package manager:
30+
Install and configure the plugin with your preferred package manager:
3231

3332
**Lazy.nvim**
3433

@@ -141,32 +140,31 @@ The plugin comes with the following defaults:
141140

142141
>lua
143142
{
144-
---@type boolean
145143
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+
149151
save_dir = vim.fn.expand(vim.fn.stdpath("data") .. "/sessions/"), -- Directory where session files are saved
150152

151-
---@type boolean
153+
follow_cwd = true, -- Change the session file to match any change in the cwd?
152154
use_git_branch = false, -- Include the git branch in the session file name?
153-
154-
---@type boolean
155155
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
158156

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
165163

166164
telescope = {
167165
mappings = { -- Mappings for managing sessions in Telescope
168-
change_branch = "<C-b>",
169166
copy_session = "<C-c>",
167+
change_branch = "<C-b>",
170168
delete_session = "<C-d>",
171169
},
172170
icons = { -- icons displayed in the Telescope picker
@@ -411,7 +409,7 @@ Neovim. A custom autocmd can be created which forces the autoload:
411409
})
412410
<
413411

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
415413
branches to be ignored:
416414

417415
>lua
@@ -427,17 +425,12 @@ branches to be ignored:
427425
"feature_branch"
428426
}
429427

430-
if utils.in_table(persisted.branch(), ignored_branches) ~= nil then
428+
if not utils.in_table(persisted.branch(), ignored_branches) then
431429
persisted.load()
432430
persisted.start()
433431
end
434432
<
435433

436-
437-
LICENSE *persisted.nvim-license*
438-
439-
MIT <https://github.com/olimorris/persisted.nvim/blob/main/LICENSE>
440-
441434
Generated by panvimdoc <https://github.com/kdheepak/panvimdoc>
442435

443436
vim:tw=78:ts=8:noet:ft=help:norl:

0 commit comments

Comments
 (0)