docs: update readme

main
olimorris 2023-02-28 17:44:10 +00:00
parent 03f11b519f
commit ca78c581da
1 changed files with 5 additions and 1 deletions

View File

@ -194,7 +194,7 @@ require("persisted").setup({
Autosaving can be further controlled for certain directories by specifying `allowed_dirs` and `ignored_dirs`. Autosaving can be further controlled for certain directories by specifying `allowed_dirs` and `ignored_dirs`.
There may be occasions when you do not wish to autosave; perhaps when a dashboard or a certain buftype is present. To control this, a callback function, `should_autosave`, may be used. This function should return a boolean value. There may be occasions when you do not wish to autosave; perhaps when a dashboard or a certain buftype is present. To control this, a callback function, `should_autosave`, may be used which should return a boolean value.
```lua ```lua
require("persisted").setup({ require("persisted").setup({
@ -208,6 +208,10 @@ require("persisted").setup({
}) })
``` ```
Of course, if you wish to manually save the session when autosaving is disabled, the `:SessionSave` command can be used.
> **Note**: If `autosave = false` then the `should_autosave` callback will not be executed.
### Autoloading ### Autoloading
The plugin can be enabled to automatically load sessions when Neovim is started. Whilst off by default, this can be turned on by: The plugin can be enabled to automatically load sessions when Neovim is started. Whilst off by default, this can be turned on by: