feat: persistence.nvim

This commit is contained in:
punkfairie 2024-11-30 18:10:09 -08:00
parent 4b7f012fc1
commit d38a941ac3
Signed by: punkfairie
GPG key ID: A509E8F77FB9D696
4 changed files with 40 additions and 1 deletions

View file

@ -36,6 +36,7 @@ with final.pkgs.lib; let
# Util
plenary-nvim
nui-nvim
persistence-nvim
# Colorscheme
rose-pine

View file

@ -42,7 +42,7 @@ return {
button(
's',
' Restore session',
'<CMD>lua require("persistence").load()<CR>'
'<CMD>lua require("lz.n").trigger_load("persistence.nvim"); require("persistence").load()<CR>'
),
button('q', ' Quit', '<CMD>qa<CR>'),

View file

@ -2,5 +2,6 @@ local req = require('lib.marleyvim').localRequire('plugins.util')
return {
req('nui-nvim'),
req('persistance-nvim'),
req('plenary'),
}

View file

@ -0,0 +1,37 @@
return {
'persistence.nvim',
event = 'BufReadPre',
keys = {
{
'<LEADER>qs',
function()
require('persistence').load()
end,
desc = 'Restore session',
},
{
'<LEADER>qS',
function()
require('persistence').select()
end,
desc = 'Select session',
},
{
'<LEADER>ql',
function()
require('persistence').load({ last = true })
end,
desc = 'Restore last session',
},
{
'<LEADER>qd',
function()
require('persistence').stop()
end,
desc = "Don't save current session",
},
},
after = function()
require('persistence').setup({})
end,
}