docs: update README.md
parent
22e17b07fb
commit
7e170b4927
|
|
@ -403,12 +403,8 @@ local ignored_branches = {
|
||||||
"feature_branch"
|
"feature_branch"
|
||||||
}
|
}
|
||||||
|
|
||||||
if utils.in_table(persisted.branch(), ignored_branches) ~= nil then
|
if not utils.in_table(persisted.branch(), ignored_branches) then
|
||||||
persisted.load()
|
persisted.load()
|
||||||
persisted.start()
|
persisted.start()
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
## :page_with_curl: License
|
|
||||||
|
|
||||||
[MIT](https://github.com/olimorris/persisted.nvim/blob/main/LICENSE)
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ Table of Contents *persisted.nvim-table-of-contents*
|
||||||
- Usage |persisted.nvim-usage|
|
- Usage |persisted.nvim-usage|
|
||||||
- Configuration |persisted.nvim-configuration|
|
- Configuration |persisted.nvim-configuration|
|
||||||
- Extending the Plugin |persisted.nvim-extending-the-plugin|
|
- Extending the Plugin |persisted.nvim-extending-the-plugin|
|
||||||
- License |persisted.nvim-license|
|
|
||||||
|
|
||||||
FEATURES *persisted.nvim-features*
|
FEATURES *persisted.nvim-features*
|
||||||
|
|
||||||
|
|
@ -28,7 +27,7 @@ REQUIREMENTS *persisted.nvim-requirements*
|
||||||
|
|
||||||
INSTALLATION *persisted.nvim-installation*
|
INSTALLATION *persisted.nvim-installation*
|
||||||
|
|
||||||
Install the plugin with your preferred package manager:
|
Install and configure the plugin with your preferred package manager:
|
||||||
|
|
||||||
**Lazy.nvim**
|
**Lazy.nvim**
|
||||||
|
|
||||||
|
|
@ -141,32 +140,31 @@ The plugin comes with the following defaults:
|
||||||
|
|
||||||
>lua
|
>lua
|
||||||
{
|
{
|
||||||
---@type boolean
|
|
||||||
autostart = true, -- Automatically start the plugin on load?
|
autostart = true, -- Automatically start the plugin on load?
|
||||||
---@type fun(boolean)
|
|
||||||
should_save = nil, -- Function to determine if a session should be saved
|
-- Function to determine if a session should be saved
|
||||||
---@type string
|
---@type fun(): boolean
|
||||||
|
should_save = function()
|
||||||
|
return true
|
||||||
|
end,
|
||||||
|
|
||||||
save_dir = vim.fn.expand(vim.fn.stdpath("data") .. "/sessions/"), -- Directory where session files are saved
|
save_dir = vim.fn.expand(vim.fn.stdpath("data") .. "/sessions/"), -- Directory where session files are saved
|
||||||
|
|
||||||
---@type boolean
|
follow_cwd = true, -- Change the session file to match any change in the cwd?
|
||||||
use_git_branch = false, -- Include the git branch in the session file name?
|
use_git_branch = false, -- Include the git branch in the session file name?
|
||||||
|
|
||||||
---@type boolean
|
|
||||||
autoload = false, -- Automatically load the session for the cwd on Neovim startup?
|
autoload = false, -- Automatically load the session for the cwd on Neovim startup?
|
||||||
---@type fun(boolean)
|
|
||||||
on_autoload_no_session = nil, -- Function to run when `autoload = true` but there is no session to load
|
|
||||||
|
|
||||||
---@type boolean
|
-- Function to run when `autoload = true` but there is no session to load
|
||||||
follow_cwd = true, -- Change session file name with changes in the cwd?
|
---@type fun(): any
|
||||||
---@type table
|
on_autoload_no_session = function() end,
|
||||||
allowed_dirs = nil, -- Table of dirs that the plugin will start and autoload from
|
|
||||||
---@type table
|
allowed_dirs = {}, -- Table of dirs that the plugin will start and autoload from
|
||||||
ignored_dirs = nil, -- Table of dirs that are ignored for autosaving and autoloading
|
ignored_dirs = {}, -- Table of dirs that are ignored for starting and autoloading
|
||||||
|
|
||||||
telescope = {
|
telescope = {
|
||||||
mappings = { -- Mappings for managing sessions in Telescope
|
mappings = { -- Mappings for managing sessions in Telescope
|
||||||
change_branch = "<C-b>",
|
|
||||||
copy_session = "<C-c>",
|
copy_session = "<C-c>",
|
||||||
|
change_branch = "<C-b>",
|
||||||
delete_session = "<C-d>",
|
delete_session = "<C-d>",
|
||||||
},
|
},
|
||||||
icons = { -- icons displayed in the Telescope picker
|
icons = { -- icons displayed in the Telescope picker
|
||||||
|
|
@ -411,7 +409,7 @@ Neovim. A custom autocmd can be created which forces the autoload:
|
||||||
})
|
})
|
||||||
<
|
<
|
||||||
|
|
||||||
Or, a user who wishes to check whether the current branch is in an a table of
|
Or, a user who wishes to check whether the current branch is in a table of
|
||||||
branches to be ignored:
|
branches to be ignored:
|
||||||
|
|
||||||
>lua
|
>lua
|
||||||
|
|
@ -427,17 +425,12 @@ branches to be ignored:
|
||||||
"feature_branch"
|
"feature_branch"
|
||||||
}
|
}
|
||||||
|
|
||||||
if utils.in_table(persisted.branch(), ignored_branches) ~= nil then
|
if not utils.in_table(persisted.branch(), ignored_branches) then
|
||||||
persisted.load()
|
persisted.load()
|
||||||
persisted.start()
|
persisted.start()
|
||||||
end
|
end
|
||||||
<
|
<
|
||||||
|
|
||||||
|
|
||||||
LICENSE *persisted.nvim-license*
|
|
||||||
|
|
||||||
MIT <https://github.com/olimorris/persisted.nvim/blob/main/LICENSE>
|
|
||||||
|
|
||||||
Generated by panvimdoc <https://github.com/kdheepak/panvimdoc>
|
Generated by panvimdoc <https://github.com/kdheepak/panvimdoc>
|
||||||
|
|
||||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue