@@ -12,7 +12,6 @@ Table of Contents *persisted.nvim-table-of-contents*
12
12
13
13
FEATURES *persisted.nvim-features*
14
14
15
-
16
15
- Supports sessions across multiple git branches
17
16
- Telescope extension to work with saved sessions
18
17
- Custom events which users can hook into for tighter integration
@@ -23,7 +22,6 @@ FEATURES *persisted.nvim-features*
23
22
24
23
REQUIREMENTS *persisted.nvim-requirements*
25
24
26
-
27
25
- Neovim >= 0.8.0
28
26
29
27
@@ -60,7 +58,7 @@ Install the plugin with your preferred package manager:
60
58
>vim
61
59
" Vim Script
62
60
Plug 'olimorris/persisted.nvim'
63
-
61
+
64
62
lua << EOF
65
63
require("persisted").setup {
66
64
-- your configuration comes here
@@ -107,7 +105,6 @@ COMMANDS ~
107
105
108
106
The plugin comes with a number of commands:
109
107
110
-
111
108
- `:SessionToggle` - Determines whether to load, start or stop a session
112
109
- `:SessionStart` - Start recording a session. Useful if `autosave = false`
113
110
- `:SessionStop` - Stop recording a session
@@ -123,7 +120,6 @@ TELESCOPE EXTENSION ~
123
120
The Telescope extension may be opened via `:Telescope persisted`. The available
124
121
actions are:
125
122
126
-
127
123
- `<CR> ` - Open/source the session file
128
124
- `<C-b> ` - Add/update the git branch for the session file
129
125
- `<C-c> ` - Copy the session file
@@ -134,7 +130,6 @@ GLOBAL VARIABLES ~
134
130
135
131
The plugin sets a number of global variables throughout its lifecycle:
136
132
137
-
138
133
- `vim .g .persisting` - (bool) Determines if the plugin is active for the current session
139
134
- `vim .g .persisted_exists` - (bool) Determines if a session exists for the current working directory
140
135
- `vim .g .persisted_loaded_session` - (string) The file path to the current session
@@ -171,7 +166,7 @@ WHAT IS SAVED IN THE SESSION? ~
171
166
172
167
As the plugin uses Vim’s `:mksession ` command then you may change the
173
168
`vim .o .sessionoptions ` value to determine what to write into the session.
174
- Please see `:h sessionoptions` for more information.
169
+ Please see | sessionoptions | for more information.
175
170
176
171
177
172
**Note**The author uses: `vim.o.sessionoptions =
@@ -356,7 +351,6 @@ EVENTS / CALLBACKS ~
356
351
357
352
The plugin fires events at various points during its lifecycle:
358
353
359
-
360
354
- `PersistedLoadPre` - For _before_ a session is loaded
361
355
- `PersistedLoadPost` - For _after_ a session is loaded
362
356
- `PersistedTelescopeLoadPre` - For _before_ a session is loaded via Telescope
@@ -379,14 +373,14 @@ session, saving the current session before clearing all of the open buffers:
379
373
380
374
>lua
381
375
local group = vim.api.nvim_create_augroup("PersistedHooks", {})
382
-
376
+
383
377
vim.api.nvim_create_autocmd({ "User" }, {
384
378
pattern = "PersistedTelescopeLoadPre",
385
379
group = group,
386
380
callback = function(session)
387
381
-- Save the currently loaded session using a global variable
388
382
require("persisted").save({ session = vim.g.persisted_loaded_session })
389
-
383
+
390
384
-- Delete all of the open buffers
391
385
vim.api.nvim_input("<ESC> :%bd!<CR> ")
392
386
end,
0 commit comments