-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
possession.lua
72 lines (64 loc) · 1.48 KB
/
possession.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
local util = require('one.util')
return {
'jedrzejboczar/possession.nvim',
config = function(config)
require('possession').setup(config.possession)
end,
defaultConfig = {
{ 'possession' },
{
session_dir = util.dataPath('sessions'),
silent = true,
load_silent = true,
debug = false,
prompt_no_cr = false,
autosave = {
current = true, -- or fun(name): boolean
tmp = false, -- or fun(): boolean
tmp_name = 'tmp',
on_load = true,
on_quit = true,
},
commands = {
save = 'SessionSave',
load = 'SessionLoad',
close = 'SessionClose',
delete = 'SessionDelete',
show = 'SessionShow',
list = 'SessionList',
migrate = 'SessionMigrate',
},
hooks = {
before_save = function(name)
return {}
end,
after_save = function(name, user_data, aborted)
end,
before_load = function(name, user_data)
return user_data
end,
after_load = function(name, user_data)
end,
},
plugins = {
close_windows = {
hooks = { 'before_save', 'before_load' },
preserve_layout = true, -- or fun(win): boolean
match = {
floating = true,
buftype = {},
filetype = {},
custom = false, -- or fun(win): boolean
},
},
delete_hidden_buffers = {
hooks = { 'before_load', vim.o.sessionoptions:match('buffer') and 'before_save' },
force = false, -- or fun(buf): boolean
},
nvim_tree = true,
tabby = true,
delete_buffers = false,
},
},
},
}