upd
This commit is contained in:
parent
2fab75fd28
commit
fd7228b0cc
7 changed files with 114 additions and 69 deletions
27
lua/plugins/resession.lua
Normal file
27
lua/plugins/resession.lua
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
return {
|
||||
{
|
||||
'stevearc/resession.nvim',
|
||||
config = function()
|
||||
local resession = require 'resession'
|
||||
resession.setup {}
|
||||
|
||||
-- Automatically save sessions on by working directory on exit
|
||||
vim.api.nvim_create_autocmd('VimLeavePre', {
|
||||
callback = function()
|
||||
resession.save(vim.fn.getcwd(), { notify = true })
|
||||
end,
|
||||
})
|
||||
|
||||
-- Automatically load sessions on startup by working directory
|
||||
vim.api.nvim_create_autocmd('VimEnter', {
|
||||
callback = function()
|
||||
-- Only load the session if nvim was started with no args
|
||||
if vim.fn.argc(-1) == 0 then
|
||||
resession.load(vim.fn.getcwd(), { silence_errors = true })
|
||||
end
|
||||
end,
|
||||
nested = true,
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue