feat: persistence.nvim
This commit is contained in:
parent
4b7f012fc1
commit
d38a941ac3
4 changed files with 40 additions and 1 deletions
|
@ -36,6 +36,7 @@ with final.pkgs.lib; let
|
|||
# Util
|
||||
plenary-nvim
|
||||
nui-nvim
|
||||
persistence-nvim
|
||||
|
||||
# Colorscheme
|
||||
rose-pine
|
||||
|
|
|
@ -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>'),
|
||||
|
|
|
@ -2,5 +2,6 @@ local req = require('lib.marleyvim').localRequire('plugins.util')
|
|||
|
||||
return {
|
||||
req('nui-nvim'),
|
||||
req('persistance-nvim'),
|
||||
req('plenary'),
|
||||
}
|
||||
|
|
37
nvim/lua/plugins/util/persistance-nvim.lua
Normal file
37
nvim/lua/plugins/util/persistance-nvim.lua
Normal 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,
|
||||
}
|
Loading…
Reference in a new issue