Replies: 2 comments 2 replies
-
return {
{ "folke/persistence.nvim", enabled = false },
{
"olimorris/persisted.nvim",
lazy = false, -- make sure the plugin is always loaded at startup
keys = {
{
"<leader>qs",
function()
require("persisted").load()
end,
desc = "Restore Session",
},
{
"<leader>ql",
function()
require("persisted").load({ last = true })
end,
desc = "Restore Last Session",
},
{
"<leader>qd",
function()
require("persisted").stop()
end,
desc = "Don't Save Current Session",
},
{
"<leader>fs",
"<cmd>Telescope persisted<cr>",
desc = "Find Session",
},
},
opts = {
save_dir = vim.fn.expand(vim.fn.stdpath("data") .. "/sessions/"), -- directory where session files are saved,resolves to ~/.local/share/nvim/my-sessions/
silent = false, -- silent nvim message when sourcing session file
use_git_branch = false, -- create session files based on the branch of a git enabled repository
default_branch = "main", -- the branch to load if a session file is not found for the current branch
autosave = true, -- automatically save session files when exiting Neovim
autoload = false, -- automatically load the session for the cwd on Neovim startup
on_autoload_no_session = nil, -- function to run when `autoload = true` but there is no session to load
follow_cwd = true, -- change session file name to match current working directory if it changes
allowed_dirs = nil, -- table of dirs that the plugin will auto-save and auto-load from
ignored_dirs = nil, -- table of dirs that are ignored when auto-saving and auto-loading
telescope = {
reset_prompt = true, -- Reset the Telescope prompt after an action?
},
should_autosave = function()
local excluded_filetypes = {
"alpha",
"oil",
"lazy",
"spectre_panel",
"",
}
for _, filetype in ipairs(excluded_filetypes) do
if vim.bo.filetype == filetype then
return false
end
end
return true
end,
},
config = function(_, options)
require("persisted").setup(options)
local ok, telescope = pcall(require, "telescope")
if not ok then
return
end
telescope.load_extension("persisted")
end,
},
}
|
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Hey @rubiin. If you can pinpoint where there is inefficiency in the plugin, I'll be happy to review a PR. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Beta Was this translation helpful? Give feedback.
All reactions