diff --git a/doc/persistence.nvim.txt b/doc/persistence.nvim.txt index e392165..011a281 100644 --- a/doc/persistence.nvim.txt +++ b/doc/persistence.nvim.txt @@ -9,6 +9,7 @@ Table of Contents *persistence.nvim-table-of-contents* - Installation |persistence.nvim-persistence-installation| - Configuration |persistence.nvim-persistence-configuration| - Usage |persistence.nvim-persistence-usage| + - Events |persistence.nvim-persistence-events| ============================================================================== 1. Persistence *persistence.nvim-persistence* @@ -53,16 +54,14 @@ Persistence comes with the following defaults: >lua { dir = vim.fn.stdpath("state") .. "/sessions/", -- directory where session files are saved - options = { "buffers", "curdir", "tabpages", "winsize" }, -- sessionoptions used for saving - pre_save = nil, -- a function to call before saving the session - post_save = nil, -- a function to call after saving the session save_empty = false, -- don't save if there are no open file buffers - pre_load = nil, -- a function to call before loading the session - post_load = nil, -- a function to call after loading the session } < + [!TIP] To configure what should be saved in your session, check |:h + 'sessionoptions'| + USAGE *persistence.nvim-persistence-usage* **Persistence** works well with plugins like `startify` or `dashboard`. It will @@ -70,16 +69,27 @@ never restore a session automatically, but you can of course write an autocmd that does exactly that if you want. >lua - -- restore the session for the current directory - vim.api.nvim_set_keymap("n", "qs", [[lua require("persistence").load()]], {}) + -- load the session for the current directory + vim.keymap.set("n", "qs", function() require("persistence").load() end) - -- restore the last session - vim.api.nvim_set_keymap("n", "ql", [[lua require("persistence").load({ last = true })]], {}) + -- select a session to load + vim.keymap.set("n", "qS", function() require("persistence").select() end) + + -- load the last session + vim.keymap.set("n", "ql", function() require("persistence").load({ last = true }) end) -- stop Persistence => session won't be saved on exit - vim.api.nvim_set_keymap("n", "qd", [[lua require("persistence").stop()]], {}) + vim.keymap.set("n", "qd", function() require("persistence").stop() end) < + +EVENTS *persistence.nvim-persistence-events* + +- **PersistenceLoadPre**before loading a session +- **PersistenceLoadPost**after loading a session +- **PersistenceSavePre**before saving a session +- **PersistenceSavePost**after saving a session + Generated by panvimdoc vim:tw=78:ts=8:noet:ft=help:norl: